summaryrefslogtreecommitdiffstats
path: root/ip6tables-restore.c
diff options
context:
space:
mode:
authorlaforge <laforge>2001-10-21 14:11:54 +0000
committerlaforge <laforge>2001-10-21 14:11:54 +0000
commit130b58b07439bd5b915dec2b84414064a1263fd7 (patch)
tree3f0b15dc595fa65c7578eae821b225b8a49a0375 /ip6tables-restore.c
parentcc9b061e7ccb9e568b3fad6c6c578c75ce9f0cfb (diff)
fix stupid bug introduced with too-lazy "-t" checking.
Diffstat (limited to 'ip6tables-restore.c')
-rw-r--r--ip6tables-restore.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/ip6tables-restore.c b/ip6tables-restore.c
index d0c778a..415f1e4 100644
--- a/ip6tables-restore.c
+++ b/ip6tables-restore.c
@@ -293,22 +293,6 @@ int main(int argc, char *argv[])
/* start command parsing at start of line */
parsestart = buffer;
}
-
- /* prevent iptables-restore from crashing in do_command
- * when someone passes a "-t" on the line.
- * - Ben Reser <ben@reser.org> */
- if (strstr(buffer, "-t")) {
- exit_error(PARAMETER_PROBLEM,
- "Line %u seems to have a "
- " -t table option.\n", line);
- exit(1);
- }
- if (!strlen((char *) &curtable)) {
- exit_error(PARAMETER_PROBLEM,
- "Line %u seems to to have a "
- " zero-length table name.\n", line);
- exit(1);
- }
add_argv(argv[0]);
add_argv("-t");
@@ -358,6 +342,14 @@ int main(int argc, char *argv[])
strncpy(param_buffer, param_start,
param_len);
*(param_buffer+param_len) = '\0';
+
+ if (!strncmp(param_buffer, "-t", 3)) {
+ exit_error(PARAMETER_PROBLEM,
+ "Line %u seems to have a "
+ "-t table option.\n", line);
+ exit(1);
+ }
+
add_argv(param_buffer);
param_start += param_len + 1;
} else {