1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-01 05:47:28 +03:00

libcli/named_pipe_auth: call smb_set_close_on_exec() in tstream_npa_socketpair()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11312

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Stefan Metzmacher 2015-06-05 09:40:19 +02:00 committed by Volker Lendecke
parent 07211343d4
commit fcf0d3ebef

View File

@ -1460,6 +1460,7 @@ int _tstream_npa_socketpair(uint16_t file_type,
int fd1;
int fd2;
int rc;
bool ok;
rc = socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
if (rc == -1) {
@ -1468,6 +1469,16 @@ int _tstream_npa_socketpair(uint16_t file_type,
fd1 = fds[0];
fd2 = fds[1];
ok = smb_set_close_on_exec(fd1);
if (!ok) {
goto close_fail;
}
ok = smb_set_close_on_exec(fd2);
if (!ok) {
goto close_fail;
}
rc = set_blocking(fd1, false);
if (rc == -1) {
goto close_fail;