From 3a26918170a6c3f237072d5bab8b0f6c8bbdffcd Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 4 Mar 2013 19:53:29 +0100 Subject: [PATCH] BUG/MEDIUM: stats: never apply "unix-bind prefix" to the global stats socket 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cfgparse.c b/src/cfgparse.c index c11c30a5f..5c3d7fab9 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -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 .. */ /* 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) {