source3/libsmb/unexpected.c set socket close on exec
authorGary Lockyer <gary@catalyst.net.nz>
Sun, 10 Dec 2017 20:54:34 +0000 (09:54 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 18 Dec 2017 03:38:20 +0000 (04:38 +0100)
commit40877f3e8af9756db29ee7bf3ab555aa2953243c
treea590b95439d5eb9e513463e706e29e5e48490ba5
parent92e801aad5aec25d0aeb3b016b02d85642ed3269
source3/libsmb/unexpected.c set socket close on exec

Set SOCKET_CLOEXEC on the sockets returned by accept.  This ensures that
the socket is unavailable to any child process created by system().
Making it harder for malicious code to set up a command channel,
as seen in the exploit for CVE-2015-0240

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/libsmb/unexpected.c