]> git.ipfire.org Git - thirdparty/iptables.git/commit
iptables-restore/save: exit when given an unknown option
authorVincent Bernat <vincent@bernat.im>
Sat, 15 Apr 2017 10:16:47 +0000 (12:16 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 19 Apr 2017 16:00:41 +0000 (18:00 +0200)
commitd89dc47ab3875f6fe6679cebceccd2000bf81b8e
treefe990365c13f083b184ccb8933cf9489577aa87b
parent65801d02a482befd2745c792d6596ec75d434934
iptables-restore/save: exit when given an unknown option

When an unknown option is given, iptables-restore should exit instead of
continue its operation. For example, if `--table` was misspelled, this
could lead to an unwanted change. Moreover, exit with a status code of
1. Make the same change for iptables-save.

OTOH, exit with a status code of 0 when requesting help.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/ip6tables-restore.c
iptables/ip6tables-save.c
iptables/iptables-restore.c
iptables/iptables-save.c
iptables/xtables-restore.c
iptables/xtables-save.c