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>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Dec 18 08:49:57 CET 2017 on sn-devel-144
return map_nt_error_from_unix_common(errno);
}
}
+ smb_set_close_on_exec(new_fd);
+
/* TODO: we could add a 'accept_check' hook here
* which get the black/white lists via socket_set_accept_filter()
return map_nt_error_from_unix_common(errno);
}
}
+ smb_set_close_on_exec(new_fd);
/* TODO: we could add a 'accept_check' hook here
* which get the black/white lists via socket_set_accept_filter()