mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-25 06:53:03 +00:00
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:
parent
6924ef8b12
commit
3a26918170
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user