From 0ab5e895f7869ea07624c666cc620576a7fde289 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 25 Sep 2014 00:28:48 +0200 Subject: s3:unix_msg: close the fds in unix_dgram_recv_handler() after the callback has run If the caller wants to use passed fds, he should copy them away and set them to -1. Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- source3/lib/unix_msg/unix_msg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source3/lib/unix_msg/unix_msg.c b/source3/lib/unix_msg/unix_msg.c index be46a43e108..48700683831 100644 --- a/source3/lib/unix_msg/unix_msg.c +++ b/source3/lib/unix_msg/unix_msg.c @@ -339,6 +339,12 @@ static void unix_dgram_recv_handler(struct poll_watch *w, int fd, short events, ctx->recv_callback(ctx, ctx->recv_buf, received, fds, num_fds, ctx->private_data); + + /* + * Close those fds that the callback has not set to -1. + */ + close_fd_array(fds, num_fds); + return; cleanup_fds: -- cgit v1.2.1