summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-09-30 09:48:18 +0200
committerMichael Adam <obnox@samba.org>2014-09-30 16:36:10 +0200
commit6e47886b154ed89182a56233d55c650885432907 (patch)
treec8ca13487529af4c67d96a41d2186010d922f79f
parent00d9ee04dd0f5c2fe5e0cd7108ed7da4b981c258 (diff)
downloadsamba-6e47886b154ed89182a56233d55c650885432907.tar.gz
s3:messaging: upon receiving fds, dup them so the caller can safely close them.
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r--source3/lib/messages.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 86198771ff8..aaaee52e3a6 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -231,8 +231,13 @@ static void messaging_recv_cb(const uint8_t *msg, size_t msg_len,
return;
}
+ /*
+ * "consume" the fds by copying them and setting
+ * the original variable to -1
+ */
for (i=0; i < num_fds; i++) {
fds64[i] = fds[i];
+ fds[i] = -1;
}
/*