]> 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>
Thu, 28 Jan 2010 22:16:37 +0000 (23:16 +0100)
Maybe appsession should be forbidden in the 'defaults' section as it
will not work in the backends.
(cherry picked from commit 3b7a369baa189aa851bed5ea92f5ed4cb5cb4418)

src/cfgparse.c

index 534e1d164ccbf732ed12f2d9dc14917fe2e6fe6c..076b16a1b5d5ff879969f6e218561bd07bb3a8ec 100644 (file)
@@ -1353,6 +1353,12 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int inv)
        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;