diff -uNr iptables-1.3.4.org/ip6tables-restore.c iptables-1.3.4/ip6tables-restore.c --- iptables-1.3.4.org/ip6tables-restore.c 2005-06-24 18:34:19.000000000 +0200 +++ iptables-1.3.4/ip6tables-restore.c 2005-11-05 22:31:32.000000000 +0100 @@ -66,11 +66,10 @@ handle = ip6tc_init(tablename); } - if (!handle) { + if (!handle) exit_error(PARAMETER_PROBLEM, "%s: unable to initialize" "table '%s'\n", program_name, tablename); - exit(1); - } + return handle; } @@ -191,12 +190,11 @@ table = strtok(buffer+1, " \t\n"); DEBUGP("line %u, table '%s'\n", line, table); - if (!table) { + if (!table) exit_error(PARAMETER_PROBLEM, "%s: line %u table name invalid\n", program_name, line); - exit(1); - } + strncpy(curtable, table, IP6T_TABLE_MAXNAMELEN); curtable[IP6T_TABLE_MAXNAMELEN] = '\0'; @@ -225,12 +223,10 @@ chain = strtok(buffer+1, " \t\n"); DEBUGP("line %u, chain '%s'\n", line, chain); - if (!chain) { + if (!chain) exit_error(PARAMETER_PROBLEM, "%s: line %u chain name invalid\n", program_name, line); - exit(1); - } if (ip6tc_builtin(chain, handle) <= 0) { if (noflush && ip6tc_is_chain(chain, handle)) { @@ -252,12 +248,10 @@ policy = strtok(NULL, " \t\n"); DEBUGP("line %u, policy '%s'\n", line, policy); - if (!policy) { + if (!policy) exit_error(PARAMETER_PROBLEM, "%s: line %u policy invalid\n", program_name, line); - exit(1); - } if (strcmp(policy, "-") != 0) { struct ip6t_counters count; @@ -381,12 +375,10 @@ /* check if table name specified */ if (!strncmp(param_buffer, "-t", 3) - || !strncmp(param_buffer, "--table", 8)) { + || !strncmp(param_buffer, "--table", 8)) 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; diff -uNr iptables-1.3.4.org/iptables-restore.c iptables-1.3.4/iptables-restore.c --- iptables-1.3.4.org/iptables-restore.c 2005-06-24 18:34:19.000000000 +0200 +++ iptables-1.3.4/iptables-restore.c 2005-11-05 22:32:21.000000000 +0100 @@ -63,11 +63,10 @@ handle = iptc_init(tablename); } - if (!handle) { + if (!handle) exit_error(PARAMETER_PROBLEM, "%s: unable to initialize" "table '%s'\n", program_name, tablename); - exit(1); - } + return handle; } @@ -194,12 +193,11 @@ table = strtok(buffer+1, " \t\n"); DEBUGP("line %u, table '%s'\n", line, table); - if (!table) { + if (!table) exit_error(PARAMETER_PROBLEM, "%s: line %u table name invalid\n", program_name, line); - exit(1); - } + strncpy(curtable, table, IPT_TABLE_MAXNAMELEN); curtable[IPT_TABLE_MAXNAMELEN] = '\0'; @@ -228,12 +226,10 @@ chain = strtok(buffer+1, " \t\n"); DEBUGP("line %u, chain '%s'\n", line, chain); - if (!chain) { + if (!chain) exit_error(PARAMETER_PROBLEM, "%s: line %u chain name invalid\n", program_name, line); - exit(1); - } if (iptc_builtin(chain, handle) <= 0) { if (noflush && iptc_is_chain(chain, handle)) { @@ -255,12 +251,10 @@ policy = strtok(NULL, " \t\n"); DEBUGP("line %u, policy '%s'\n", line, policy); - if (!policy) { + if (!policy) exit_error(PARAMETER_PROBLEM, "%s: line %u policy invalid\n", program_name, line); - exit(1); - } if (strcmp(policy, "-") != 0) { struct ipt_counters count; @@ -384,12 +378,10 @@ /* check if table name specified */ if (!strncmp(param_buffer, "-t", 3) - || !strncmp(param_buffer, "--table", 8)) { + || !strncmp(param_buffer, "--table", 8)) 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;