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:
parent
07211343d4
commit
fcf0d3ebef
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user