BUG/MEDIUM: namespace: fix fd leak in master-worker mode

When namespaces are used in the configuration, the respective namespace handles
are opened during config parsing and stored in an ebtree for lookup later.

Unfortunately, when the master process re-execs itself these file descriptors
were not closed, effectively leaking the fds and preventing destruction of
namespaces no longer present in the configuration.

This change fixes this issue by opening the namespace file handles as
close-on-exec, making sure that they will be closed during re-exec.

(cherry picked from commit 538aa7168fca1adf2ecd0aa4a47e6b8856275f55)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed