]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stats: never apply "unix-bind prefix" to the global stats socket
authorWilly Tarreau <w@1wt.eu>
Mon, 4 Mar 2013 18:53:29 +0000 (19:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 8 Mar 2013 13:04:42 +0000 (14:04 +0100)
The "unix-bind prefix" feature was made for explicit "bind" statements. Since
the stats socket was changed to use str2listener(), it implicitly inherited
from this feature. But both are defined in the global section, and we don't
want them to be position-dependant.

So let's make str2listener() explicitly not apply the unix-bind prefix to the
global stats frontend.

This only affects 1.5-dev so it does not need any backport.

src/cfgparse.c

index c11c30a5f72e448a0b8184458b49783f5d6b0ae1..5c3d7fab965dda5015c2ecff731f875747b20889 100644 (file)
@@ -217,7 +217,7 @@ int str2listener(char *str, struct proxy *curproxy, struct bind_conf *bind_conf,
                if (*str == '/') {
                        /* sun_path during a soft_stop rename is <unix_bind_prefix><path>.<pid>.<bak|tmp> */
                        /* so compute max path */
-                       int prefix_path_len = global.unix_bind.prefix ? strlen(global.unix_bind.prefix) : 0;
+                       int prefix_path_len = (curproxy != global.stats_fe && global.unix_bind.prefix) ? strlen(global.unix_bind.prefix) : 0;
                        int max_path_len = (sizeof(((struct sockaddr_un *)&ss)->sun_path) - 1) - (prefix_path_len + 1 + 5 + 1 + 3);
 
                        if (strlen(str) > max_path_len) {