summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-restore.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-09-17 16:45:20 +0200
committerPhil Sutter <phil@nwl.cc>2019-10-18 11:57:21 +0200
commitfe2c53d570bf7a301b0cb5aa25b1186a47378a6b (patch)
tree8300a3bb5ea0451292cee478cb420157842bb6f3 /iptables/xtables-restore.c
parent2718697373b042736bf8a9ee501f6a724193a6d9 (diff)
xtables-restore: Use xt_params->program_name
Instead of setting newargv[0] to argv[0]'s value, just use whatever xt_params->program_name contains. The latter is arbitrarily defined, but may still be more correct than real argv[0] which may simply be for instance xtables-nft-multi. Either way, there is no practical significance since newargv[0] is used exclusively in debug output. Signed-off-by: Phil Sutter <phil@nwl.cc> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/xtables-restore.c')
-rw-r--r--iptables/xtables-restore.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c
index cb03104e..24bfce51 100644
--- a/iptables/xtables-restore.c
+++ b/iptables/xtables-restore.c
@@ -87,8 +87,7 @@ static const struct xtc_ops xtc_ops = {
void xtables_restore_parse(struct nft_handle *h,
const struct nft_xt_restore_parse *p,
- struct nft_xt_restore_cb *cb,
- int argc, char *argv[])
+ struct nft_xt_restore_cb *cb)
{
const struct builtin_table *curtable = NULL;
char buffer[10240];
@@ -264,7 +263,7 @@ void xtables_restore_parse(struct nft_handle *h,
parsestart = buffer;
}
- add_argv(argv[0], 0);
+ add_argv(xt_params->program_name, 0);
add_argv("-t", 0);
add_argv(curtable->name, 0);
@@ -434,7 +433,7 @@ xtables_restore_main(int family, const char *progname, int argc, char *argv[])
exit(EXIT_FAILURE);
}
- xtables_restore_parse(&h, &p, &restore_cb, argc, argv);
+ xtables_restore_parse(&h, &p, &restore_cb);
nft_fini(&h);
fclose(p.in);
@@ -500,7 +499,7 @@ int xtables_eb_restore_main(int argc, char *argv[])
nft_init_eb(&h, "ebtables-restore");
h.noflush = noflush;
- xtables_restore_parse(&h, &p, &ebt_restore_cb, argc, argv);
+ xtables_restore_parse(&h, &p, &ebt_restore_cb);
nft_fini(&h);
return 0;
@@ -524,7 +523,7 @@ int xtables_arp_restore_main(int argc, char *argv[])
struct nft_handle h;
nft_init_arp(&h, "arptables-restore");
- xtables_restore_parse(&h, &p, &arp_restore_cb, argc, argv);
+ xtables_restore_parse(&h, &p, &arp_restore_cb);
nft_fini(&h);
return 0;