BUG/MINOR: init: fix set-dumpable when using uid/gid
authorWilliam Dauchy <w.dauchy@criteo.com>
Sun, 17 Nov 2019 14:47:15 +0000 (15:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 17 Nov 2019 15:55:24 +0000 (16:55 +0100)
commite039f26ba463023282356096ec1cc0d110613e5c
treef8dd5ec3f23f40d8a769d07b80a726190f2a6ccf
parent846813260ddb133a5f18ebf8c66c7267d10ab6f7
BUG/MINOR: init: fix set-dumpable when using uid/gid

in mworker mode used with uid/gid settings, it was not possible to get
a coredump despite the set-dumpable option.
indeed prctl(2) manual page specifies the dumpable attribute is reverted
to `/proc/sys/fs/suid_dumpable` in a few conditions such as process
effective user and group are changed.

this patch moves the whole set-dumpable logic before the polling code in
order to catch all possible cases where we could have changed the
uid/gid. It however does not cover the possible segfault at startup.

this patch should be backported in 2.0.

Signed-off-by: William Dauchy <w.dauchy@criteo.com>
src/haproxy.c