aboutsummaryrefslogtreecommitdiffstats
path: root/main/ipset
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2017-03-21 12:03:03 +0200
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2017-03-21 12:04:33 +0200
commit727d3b879fa8593da80813e43fbd57e08fb2bc32 (patch)
tree0e38bdb9c80ab770d3d14df1f5fefa2e001ad792 /main/ipset
parent4b7635b32da60305c8b90644642b6a9996c1cc29 (diff)
downloadaports-727d3b879fa8593da80813e43fbd57e08fb2bc32.tar.bz2
aports-727d3b879fa8593da80813e43fbd57e08fb2bc32.tar.xz
main/ipset: fix race conditions in init script
Diffstat (limited to 'main/ipset')
-rw-r--r--main/ipset/APKBUILD4
-rw-r--r--main/ipset/ipset.initd16
2 files changed, 11 insertions, 9 deletions
diff --git a/main/ipset/APKBUILD b/main/ipset/APKBUILD
index b5951709ce..224f3bb71b 100644
--- a/main/ipset/APKBUILD
+++ b/main/ipset/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
pkgname=ipset
pkgver=6.32
-pkgrel=1
+pkgrel=2
pkgdesc="Manage Linux IP sets"
url=http://ipset.netfilter.org/
arch="all"
@@ -45,4 +45,4 @@ package() {
}
sha512sums="7b0f5e7ef1a777ab70872aa52f658ff9516cb5de4c67c56d7f596eb88db03467d39b10ffc098441b4bfa4bb21a15f3c5f7f7f825300ce8efbacd767369ad43c7 ipset-6.32.tar.bz2
-deafc83f58e9abba9c9c399c246dcb687d4f5295b1807b923b8c02922584b70c2642221257f577e1cd86006b89ded08784d4d2953d6f043d7621f61eb83f1af7 ipset.initd"
+3b65c2cfc3c85240c988b7f1d63131e0d364c9605c6b81184167c17b6820c7cab2818f765a90790946954bcf700024a088238a1c9ebddf1667288f5562c4b8ce ipset.initd"
diff --git a/main/ipset/ipset.initd b/main/ipset/ipset.initd
index ee1668939b..2678c007e8 100644
--- a/main/ipset/ipset.initd
+++ b/main/ipset/ipset.initd
@@ -95,7 +95,9 @@ reload() {
fi
echo create $new $(set_file $name | head -n 1)
done
+ ) | ipset restore
+ (
for name in $(set_files); do
local new=$name
set_exists _init_$name && new=_init_$name
@@ -105,15 +107,15 @@ reload() {
for name in $swap; do
echo swap $name _init_$name
done
+ ) | ipset restore
- for name in $(set_lists); do
- [ -f $DIR/$name ] || echo destroy $name
- done
+ for name in $(set_lists); do
+ [ -f $DIR/$name ] || echo destroy $name
+ done | ipset restore
- for name in $(sets); do
- [ -f $DIR/$name ] || echo destroy $name
- done
- ) | ipset restore
+ for name in $(sets); do
+ [ -f $DIR/$name ] || echo destroy $name
+ done | ipset restore
eend $STATUS
}