source3/utils/smbfilter.c set socket close on exec
authorGary Lockyer <gary@catalyst.net.nz>
Sun, 10 Dec 2017 20:57:04 +0000 (09:57 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 18 Dec 2017 03:38:20 +0000 (04:38 +0100)
commit562ac9a9559802b64cb8b2990a8172444040a1c8
tree31ab35d8a2f7184ce2d56ab86299054b8e60871b
parent40877f3e8af9756db29ee7bf3ab555aa2953243c
source3/utils/smbfilter.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/utils/smbfilter.c