BUG/MEDIUM: mworker: don't register mworker_accept_wrapper() when master FD is wrong

This patch handles the case where the fd could be -1 when proc_self was
lost for some reason (environment variable corrupted or upgrade from < 1.9).

This could result in a out of bound array access fdtab[-1] and would crash.

Must be backported in every maintained versions.

(cherry picked from commit cc5b9fa593e139fa330f8c7161ff7514315f2837)
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
(cherry picked from commit 49650955ae6a581226aeb7186650f4a45643a7ce)
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
(cherry picked from commit 2f874eaab7c4b4dbe3b485d05f3e46887d72c7c1)
[wla: context change, s/fd_set_nonblock/fcntl/]
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
(cherry picked from commit 67ac05465a32dbf82fc750b8bb722f3ef87d029b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed