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.
This commit is contained in:
Willy Tarreau 2013-03-04 19:53:29 +01:00
parent 6924ef8b12
commit 3a26918170

View 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) {