From: Andrew Tridgell Date: Wed, 4 Jul 2007 07:43:26 +0000 (+0000) Subject: r23701: when we create a new socket with socket_accept(), clear any flags that X-Git-Tag: samba-misc-tags/initial-v4-0-unstable~683 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=4e31eda055781a710d285c509d0c51b42e351431;hp=ff41bdc350cf05c70c63effe30fe69e63181f088;ds=sidebyside r23701: when we create a new socket with socket_accept(), clear any flags that were set in the old one. Otherwise SOCKET_FLAG_NOCLOSE causes a major fd leak --- diff --git a/source/lib/socket/socket.c b/source/lib/socket/socket.c index 548b11ebcc9..89f8fe5a56f 100644 --- a/source/lib/socket/socket.c +++ b/source/lib/socket/socket.c @@ -166,6 +166,7 @@ _PUBLIC_ NTSTATUS socket_accept(struct socket_context *sock, struct socket_conte if (NT_STATUS_IS_OK(status)) { talloc_set_destructor(*new_sock, socket_destructor); + (*new_sock)->flags = 0; } return status;