]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: unix: remove the 'level' field from the ux struct
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2013 14:17:20 +0000 (15:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2013 15:19:19 +0000 (16:19 +0100)
Commit 290e63aa moved the unix parameters out of the global stats socket
to the bind_conf struct. As such the stats admin level was also moved
overthere, but it remained in the stats global section where it was not
used, except by a nasty memcpy() used to initialize the ux struct in the
bind_conf with too large data. Fortunately, the extra data copied were
the previous level over the new level so it did not have any impact, but
it could have been worse.

This bug is 1.5 specific, no backport is needed.

Reported-by: Dinko Korunic <dkorunic@reflected.net>
include/types/global.h
src/cfgparse.c

index bfc1a351be99d6fddf8eba03bb2b1ec8aa88f0c4..133a98dc8a9c11098111c7c36b221c95666aca06 100644 (file)
@@ -129,7 +129,6 @@ struct global {
                        uid_t uid;      /* -1 to leave unchanged */
                        gid_t gid;      /* -1 to leave unchanged */
                        mode_t mode;    /* 0 to leave unchanged */
-                       int level;      /* access level (ACCESS_LVL_*) */
                } ux;
        } unix_bind;
 #ifdef USE_CPU_AFFINITY
index 949114792faf97a07e8ae2acaca80dcba1304873..dd89c9472be98b549bd1a17db3c580ae2eed095b 100644 (file)
@@ -1943,7 +1943,11 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                }
 
                bind_conf = bind_conf_alloc(&curproxy->conf.bind, file, linenum, args[1]);
-               memcpy(&bind_conf->ux, &global.unix_bind.ux, sizeof(global.unix_bind.ux));
+
+               /* use default settings for unix sockets */
+               bind_conf->ux.uid  = global.unix_bind.ux.uid;
+               bind_conf->ux.gid  = global.unix_bind.ux.gid;
+               bind_conf->ux.mode = global.unix_bind.ux.mode;
 
                /* NOTE: the following line might create several listeners if there
                 * are comma-separated IPs or port ranges. So all further processing