diff options
author | Bart De Schuymer <bdschuym@pandora.be> | 2002-08-24 21:01:21 +0000 |
---|---|---|
committer | Bart De Schuymer <bdschuym@pandora.be> | 2002-08-24 21:01:21 +0000 |
commit | 27f67b811288792e9749dbec0751161b80f38cf7 (patch) | |
tree | 90b6eec8dc590faa2c8be854de1a17b5bf162fd3 | |
parent | c96e724b48fabf7f8e7dcf0f763cde12563fb678 (diff) |
*** empty log message ***
-rw-r--r-- | userspace/ebtables2/communication.c | 6 | ||||
-rw-r--r-- | userspace/ebtables2/ebtables.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/userspace/ebtables2/communication.c b/userspace/ebtables2/communication.c index 184a4c1..887ee08 100644 --- a/userspace/ebtables2/communication.c +++ b/userspace/ebtables2/communication.c @@ -656,9 +656,11 @@ int get_table(struct ebt_u_replace *u_repl) struct ebt_u_entry **u_e; strcpy(repl.name, u_repl->name); - if (u_repl->filename != NULL) + if (u_repl->filename != NULL) { retrieve_from_file(u_repl->filename, &repl, u_repl->command); - else if (retrieve_from_kernel(&repl, u_repl->command) == -1) + // -L with a wrong table name should be dealt with silently + strcpy(u_repl->name, repl.name); + } else if (retrieve_from_kernel(&repl, u_repl->command) == -1) return -1; // translate the struct ebt_replace to a struct ebt_u_replace diff --git a/userspace/ebtables2/ebtables.c b/userspace/ebtables2/ebtables.c index 54fd2b0..2ace08c 100644 --- a/userspace/ebtables2/ebtables.c +++ b/userspace/ebtables2/ebtables.c @@ -1462,6 +1462,10 @@ static void get_kernel_table(const char *modprobe) print_error("The kernel doesn't support the ebtables " "%s table", replace.name); } + // when listing a table contained in a file, we don't expect the user + // to know what the table's name is + if ( !(table = find_table(replace.name)) ) + print_error("Bad table name"); } #define print_if_l_error print_error("Interface name length must be less " \ |