diff options
author | Stefan Metzmacher <metze@samba.org> | 2015-06-05 09:40:19 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2015-06-05 14:33:19 +0200 |
commit | fcf0d3ebefa5be809a0dd082055888ed99a5c003 (patch) | |
tree | d83d63cd276037d8074a4d0b2d25b02e031598e8 /libcli/named_pipe_auth/npa_tstream.c | |
parent | 07211343d461275f9f5feddcbf95e36225bd059a (diff) | |
download | samba-fcf0d3ebefa5be809a0dd082055888ed99a5c003.tar.gz |
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>
Diffstat (limited to 'libcli/named_pipe_auth/npa_tstream.c')
-rw-r--r-- | libcli/named_pipe_auth/npa_tstream.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libcli/named_pipe_auth/npa_tstream.c b/libcli/named_pipe_auth/npa_tstream.c index 35392021275..20ae3de8154 100644 --- a/libcli/named_pipe_auth/npa_tstream.c +++ b/libcli/named_pipe_auth/npa_tstream.c @@ -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; |