]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables-*-restore: Drop pointless line reference
authorPhil Sutter <phil@nwl.cc>
Fri, 26 Nov 2021 20:45:12 +0000 (21:45 +0100)
committerPhil Sutter <phil@nwl.cc>
Thu, 16 Dec 2021 13:30:29 +0000 (14:30 +0100)
There's no need to mention the offending line number in error message
when calling xtables_error() with a status of PARAMETER_PROBLEM as that
will cause a call to xtables_exit_tryhelp() which in turn prints "Error
occurred at line: N".

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/ip6tables.c
iptables/iptables.c
iptables/xtables-eb.c
iptables/xtables.c

index 2f3ff034fbbb76fed2256f51326d81d74799b466..b4604f83cf8a4001b0e3e91379c6833ae20ba3bc 100644 (file)
@@ -1012,8 +1012,8 @@ int do_command6(int argc, char *argv[], char **table,
                                           "unexpected ! flag before --table");
                        if (restore && table_set)
                                xtables_error(PARAMETER_PROBLEM,
-                                             "The -t option (seen in line %u) cannot be used in %s.\n",
-                                             line, xt_params->program_name);
+                                             "The -t option cannot be used in %s.\n",
+                                             xt_params->program_name);
                        *table = optarg;
                        table_set = true;
                        break;
index ba04fbc6a806ed0ca3e59102e9fe272bc4645cae..7dc4cbc1c9c223e67fd18dcbedd27af367c4a7b0 100644 (file)
@@ -994,8 +994,8 @@ int do_command4(int argc, char *argv[], char **table,
                                           "unexpected ! flag before --table");
                        if (restore && table_set)
                                xtables_error(PARAMETER_PROBLEM,
-                                             "The -t option (seen in line %u) cannot be used in %s.\n",
-                                             line, xt_params->program_name);
+                                             "The -t option cannot be used in %s.\n",
+                                             xt_params->program_name);
                        *table = optarg;
                        table_set = true;
                        break;
index ed8f733246ca3f74575759361151d3cae12d9d32..060e06c57a481cb7ad67a6915bc5540ab0c0d81e 100644 (file)
@@ -894,8 +894,8 @@ print_zero:
                        ebt_check_option2(&flags, OPT_TABLE);
                        if (restore && table_set)
                                xtables_error(PARAMETER_PROBLEM,
-                                             "The -t option (seen in line %u) cannot be used in %s.\n",
-                                             line, xt_params->program_name);
+                                             "The -t option cannot be used in %s.\n",
+                                             xt_params->program_name);
                        if (!nft_table_builtin_find(h, optarg))
                                xtables_error(VERSION_PROBLEM,
                                              "table '%s' does not exist",
index 5255fa340d55d1e4bed2e61e5b86f87146b82731..57bec76c31fb33823555c8c1b667434e6efa5f1e 100644 (file)
@@ -512,8 +512,8 @@ void do_parse(struct nft_handle *h, int argc, char *argv[],
                                           "unexpected ! flag before --table");
                        if (p->restore && table_set)
                                xtables_error(PARAMETER_PROBLEM,
-                                             "The -t option (seen in line %u) cannot be used in %s.\n",
-                                             line, xt_params->program_name);
+                                             "The -t option cannot be used in %s.\n",
+                                             xt_params->program_name);
                        if (!nft_table_builtin_find(h, optarg))
                                xtables_error(VERSION_PROBLEM,
                                              "table '%s' does not exist",