net-firewall/nftables: Fix SAVE_OPTIONS bug in libexec scripts
authorNicholas Vinson <nvinson234@gmail.com>
Sat, 7 Jan 2017 14:54:28 +0000 (06:54 -0800)
committerRobin H. Johnson <robbat2@gentoo.org>
Sat, 7 Jan 2017 21:46:02 +0000 (13:46 -0800)
The libexec script doesn't honor the SAVE_OPTIONS variable.  This commit fixes
that issue.

Thanks to Phil@nwl.cc for providing the fix for the issue.

Gentoo-bug: 603228

Package-Manager: Portage-2.3.3, Repoman-2.3.1

net-firewall/nftables/files/libexec/nftables.sh
net-firewall/nftables/files/nftables.init

index f720b9bfc514f24f33ea637d767b292d0a17e88b..cc55f8566000d49b6f01190bbc20ad2dccf8dfbd 100755 (executable)
@@ -27,7 +27,7 @@ main() {
         "store")
             local tmp_save="${NFTABLES_SAVE}.tmp"
             if ! use_legacy; then
-                nft list ruleset > ${tmp_save}
+                nft ${SAVE_OPTIONS} list ruleset > ${tmp_save}
             else
                 save_legacy ${tmp_save}
             fi
index 217251e41db49ecdf3bdfa90485a8a67340ef699..cf4ab8b5f44bc94eb73d8e4996ffb8725c8f5600 100644 (file)
@@ -1,6 +1,6 @@
 #!/sbin/openrc-run
-# Copyright 2014-2016 Nicholas Vinson
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 2014-2017 Nicholas Vinson
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 extra_commands="clear list panic save"
@@ -83,6 +83,7 @@ save() {
     ebegin "Saving nftables state"
     checkpath -q -d "$(dirname "${NFTABLES_SAVE}")"
     checkpath -q -m 0600 -f "${NFTABLES_SAVE}"
+    export SAVE_OPTIONS
     /usr/libexec/nftables/nftables.sh store ${NFTABLES_SAVE}
     return $?
 }