BUG/MINOR: cfgparse-tcp: relax namespace bind check
authorDamien Claisse <d.claisse@criteo.com>
Fri, 20 Dec 2024 13:36:34 +0000 (13:36 +0000)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Mar 2025 15:23:44 +0000 (16:23 +0100)
commit736148fdb24c6b45a697e3f2b34600284e7a9aff
tree5bea53d608facd50d0096c56c6101b3341f50326
parenta7d85464c04bafabd6fa8eed83a421fe1aa445a6
BUG/MINOR: cfgparse-tcp: relax namespace bind check

Commit 5cbb278 introduced cap_sys_admin support, and enforced checks for
both binds and servers. However, when binding into a namespace, the bind
is done before dropping privileges. Hence, checking that we have
cap_sys_admin capability set in this case is not needed (and it would
decrease security to add it).
For users starting haproxy with other user than root and without
cap_sys_admin, bind should have already failed.
As a consequence, relax runtime check for binds into a namespace.

(cherry picked from commit f0a07f834c001c5b505e84b0f0b103e530e87d1b)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 42086a672888f569e009149130fad7b19b3fd13d)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/cfgparse-tcp.c