s4-ldap_server: Fix segfault on startup failure of ldap server
authorAndrew Bartlett <abartlet@samba.org>
Mon, 26 Sep 2011 22:56:23 +0000 (15:56 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 27 Sep 2011 20:43:06 +0000 (22:43 +0200)
source4/ldap_server/ldap_server.c

index 411be294401a67b3b4567783a9fb9faae45d857f..69a99aa0f36dad567f6ae20dc2c29b7fb204b65b 100644 (file)
@@ -334,6 +334,8 @@ static void ldapsrv_accept(struct stream_connection *c,
 
        conn->session_info = session_info;
 
 
        conn->session_info = session_info;
 
+       conn->sockets.active = conn->sockets.raw;
+
        if (!NT_STATUS_IS_OK(ldapsrv_backend_Init(conn))) {
                ldapsrv_terminate_connection(conn, "backend Init failed");
                return;
        if (!NT_STATUS_IS_OK(ldapsrv_backend_Init(conn))) {
                ldapsrv_terminate_connection(conn, "backend Init failed");
                return;
@@ -345,8 +347,6 @@ static void ldapsrv_accept(struct stream_connection *c,
        /* register the server */       
        irpc_add_name(c->msg_ctx, "ldap_server");
 
        /* register the server */       
        irpc_add_name(c->msg_ctx, "ldap_server");
 
-       conn->sockets.active = conn->sockets.raw;
-
        if (port != 636 && port != 3269) {
                ldapsrv_call_read_next(conn);
                return;
        if (port != 636 && port != 3269) {
                ldapsrv_call_read_next(conn);
                return;