From ed30c6bd6f4e9745468b095fbf8b1d0bd9844114 Mon Sep 17 00:00:00 2001 From: Stephane Ouellette Date: Sun, 27 Apr 2003 13:07:18 +0000 Subject: the following two patches move the call to check_inverse() to a saner place and surround the condition name by double-quotes in save(). (Stephane Ouellette) --- extensions/libipt_condition.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'extensions/libipt_condition.c') diff --git a/extensions/libipt_condition.c b/extensions/libipt_condition.c index f15c94ca..750111b4 100644 --- a/extensions/libipt_condition.c +++ b/extensions/libipt_condition.c @@ -1,3 +1,4 @@ +/* Shared library add-on to iptables for condition match */ #include #include #include @@ -39,13 +40,13 @@ parse(int c, char **argv, int invert, unsigned int *flags, struct condition_info *info = (struct condition_info *) (*match)->data; - check_inverse(optarg, &invert, &optind, 0); - if (c == 'X') { if (*flags) exit_error(PARAMETER_PROBLEM, "Can't specify multiple conditions"); + check_inverse(optarg, &invert, &optind, 0); + if (strlen(argv[optind - 1]) < CONDITION_NAME_LEN) strcpy(info->name, argv[optind - 1]); else @@ -88,7 +89,7 @@ save(const struct ipt_ip *ip, const struct condition_info *info = (const struct condition_info *) match->data; - printf("--condition %s%s ", (info->invert) ? "! " : "", info->name); + printf("--condition %s\"%s\" ", (info->invert) ? "! " : "", info->name); } -- cgit v1.2.3