]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: fcgi-app: prevent 'use-fcgi-app' in default section
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 12 Jan 2023 14:44:22 +0000 (15:44 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 27 Jan 2023 14:18:59 +0000 (15:18 +0100)
Despite the doc saying that 'use-fcgi-app' keyword may only be used in backend
or listen section, we forgot to prevent its usage in default section.

This is wrong because fcgi relies on a filter, and filters cannot be defined in
a default section.

Making sure such usage reports an error to the user and complies with the doc.

This could be backported up to 2.2.

src/fcgi-app.c

index c9405ec4dd65d15656001ef112a921fc925dd020..1ece72b25818b55e0816f5032ab7e9ae463e7ccc 100644 (file)
@@ -589,7 +589,7 @@ static int proxy_parse_use_fcgi_app(char **args, int section, struct proxy *curp
        struct fcgi_flt_conf *fcgi_conf = NULL;
        int retval = 0;
 
-       if (!(curpx->cap & PR_CAP_BE)) {
+       if ((curpx->cap & PR_CAP_DEF) || !(curpx->cap & PR_CAP_BE)) {
                memprintf(err, "'%s' only available in backend or listen section", args[0]);
                retval = -1;
                goto end;