]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxt_string: escape the escaping char too
authorJan Engelhardt <jengelh@medozas.de>
Fri, 26 Aug 2011 12:46:40 +0000 (14:46 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Fri, 26 Aug 2011 12:46:40 +0000 (14:46 +0200)
References: http://bugzilla.netfilter.org/show_bug.cgi?id=740
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
extensions/libxt_string.c
tests/options-most.rules

index 472035fbb46e293a6cec4bb838c29f14409583e1..fb15980e4a73fc490c904a97e4c5804f847f6088 100644 (file)
@@ -242,7 +242,7 @@ print_string(const char *str, const unsigned short int len)
        unsigned int i;
        printf(" \"");
        for (i=0; i < len; i++) {
-               if (str[i] == '\"')  /* escape any embedded quotes */
+               if (str[i] == '\"' || str[i] == '\\')
                        putchar('\\');
                printf("%c", (unsigned char) str[i]);
        }
index e54eb1277f1b19868a5c1f6d527ddcff087d0545..ae28b82d8069e544edda8b4ebce0b574d40e5e06 100644 (file)
 -A matches
 -A matches -m statistic --mode nth ! --every 5 --packet 2
 -A matches
+-A matches -m string --hex-string "action=|5C22|http|3A|" --algo bm
+-A matches
+-A matches -m string --hex-string "action=|5C|http|3A|" --algo bm
+-A matches
 -A matches -m time --timestart 01:02:03 --timestop 04:05:06 --monthdays 1,2,3,4,5 --weekdays Mon,Fri,Sun --datestart 2001-02-03T04:05:06 --datestop 2012-09-08T09:06:05 --localtz
 -A matches
 -A matches -m time --timestart 01:02:03 --timestop 04:05:06 --monthdays 1,2,3,4,5 --weekdays Mon,Fri,Sun --datestart 2001-02-03T04:05:06 --datestop 2012-09-08T09:06:05 --kerneltz