]> git.kaiwu.me - haproxy.git/commitdiff
[BUG] config: fix erroneous check on cookie domain names
authorWilly Tarreau <w@1wt.eu>
Thu, 3 Dec 2009 22:10:56 +0000 (23:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 3 Dec 2009 22:54:06 +0000 (23:54 +0100)
It was a OR instead of a AND, so it was required to have a cookie
name which contained a dot AND began with a dot.
(cherry picked from commit a1e107fc13e5d8886bf900f302322bfa6ed35d37)

src/cfgparse.c

index 801cf820d3073fe69a9c4511b6ff50ca4f441fde..7a714ec895b4667884fcd5eaf2355dcae55189dd 100644 (file)
@@ -914,10 +914,10 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int inv)
                                        return -1;
                                }
 
-                               if (*args[cur_arg + 1] != '.' || !strchr(args[cur_arg + 1] + 1, '.')) {
+                               if (*args[cur_arg + 1] != '.' && !strchr(args[cur_arg + 1] + 1, '.')) {
                                        /* rfc2109, 4.3.2 Rejecting Cookies */
                                        Alert("parsing [%s:%d]: domain '%s' contains no embedded"
-                                               " dots or does not start with a dot.\n",
+                                               " dots and does not start with a dot.\n",
                                                file, linenum, args[cur_arg + 1]);
                                        return -1;
                                }