]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] config: don't accept 'appsession' in defaults section
authorCyril Bonté <cyril.bonte@free.fr>
Sun, 10 Jan 2010 16:01:47 +0000 (17:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 10 Jan 2010 16:47:28 +0000 (17:47 +0100)
Maybe appsession should be forbidden in the 'defaults' section as it
will not work in the backends.

src/cfgparse.c

index 13e1cfdf8e6ef518258cfd0eb67c16fbccb63262..978162386ee85ceb996ead69b6b3327abef93592 100644 (file)
@@ -1580,6 +1580,12 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
        else if (!strcmp(args[0], "appsession")) {  /* cookie name */
                int cur_arg;
 
+               if (curproxy == &defproxy) {
+                       Alert("parsing [%s:%d] : '%s' not allowed in 'defaults' section.\n", file, linenum, args[0]);
+                       err_code |= ERR_ALERT | ERR_FATAL;
+                       goto out;
+               }
+
                if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
                        err_code |= ERR_WARN;