]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libip6t_LOG: target output is different to libipt_LOG
authorPhil Oester <kernel@linuxace.com>
Sat, 6 Jul 2013 15:56:01 +0000 (08:56 -0700)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 24 Jul 2013 18:45:07 +0000 (20:45 +0200)
libipt_LOG is using the xtables_save_string func, which
escapes unsafe characters as needed. libip6t_LOG should
do the same.

Signed-off-by: Phil Oester <kernel@linuxace.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
extensions/libip6t_LOG.c

index 2b1ae2893a956744005ee8bcd42a514838d7e4d4..4639268dc9d466d6608c2f2e456f1ce44f3501ca 100644 (file)
@@ -146,8 +146,10 @@ static void LOG_save(const void *ip, const struct xt_entry_target *target)
        const struct ip6t_log_info *loginfo
                = (const struct ip6t_log_info *)target->data;
 
-       if (strcmp(loginfo->prefix, "") != 0)
-               printf(" --log-prefix \"%s\"", loginfo->prefix);
+       if (strcmp(loginfo->prefix, "") != 0) {
+               printf(" --log-prefix");
+               xtables_save_string(loginfo->prefix);
+       }
 
        if (loginfo->level != LOG_DEFAULT_LEVEL)
                printf(" --log-level %d", loginfo->level);