r23701: when we create a new socket with socket_accept(), clear any flags that
authorAndrew Tridgell <tridge@samba.org>
Wed, 4 Jul 2007 07:43:26 +0000 (07:43 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:59:05 +0000 (14:59 -0500)
were set in the old one. Otherwise SOCKET_FLAG_NOCLOSE causes a major
fd leak
(This used to be commit 4e31eda055781a710d285c509d0c51b42e351431)

source4/lib/socket/socket.c

index 548b11ebcc98d424800dc66f8d3fff2be6b4bf57..89f8fe5a56fac26dcc1d618a018241aaa2aa5614 100644 (file)
@@ -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;