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

source/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);
 
        if (NT_STATUS_IS_OK(status)) {
                talloc_set_destructor(*new_sock, socket_destructor);
+               (*new_sock)->flags = 0;
        }
 
        return status;
        }
 
        return status;