ctdb/tcp/tcp_connect.c set socket close on exec
authorGary Lockyer <gary@catalyst.net.nz>
Sun, 10 Dec 2017 20:37:28 +0000 (09:37 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 18 Dec 2017 03:38:20 +0000 (04:38 +0100)
commit34f7894719dccd701f2bd9eee5669ea8b1ab7473
treeb039d385688ed8e961b34d5bf15030dc7dffe9bc
parent9ccf164550ab139edf123d00f68fd43d500d734c
ctdb/tcp/tcp_connect.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>
ctdb/tcp/tcp_connect.c