s3:rpc_server: make use of netsec_create_state()
authorStefan Metzmacher <metze@samba.org>
Fri, 2 Aug 2013 11:33:37 +0000 (13:33 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 10 Aug 2013 07:18:58 +0000 (09:18 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_server/srv_pipe.c

index 894f12c2e906090ecba5b8c25008f88b26d90591..49a27b9b0bc0df8e75166983ade0ae4ca4b76e26 100644 (file)
@@ -462,8 +462,8 @@ static bool pipe_schannel_auth_bind(struct pipes_struct *p,
         */
 
        become_root();
-       status = schannel_get_creds_state(p, lp_ctx,
-                                           neg.oem_netbios_computer.a, &creds);
+       status = schannel_get_creds_state(p->mem_ctx, lp_ctx,
+                                         neg.oem_netbios_computer.a, &creds);
        unbecome_root();
        
        talloc_unlink(p, lp_ctx);
@@ -472,16 +472,12 @@ static bool pipe_schannel_auth_bind(struct pipes_struct *p,
                return False;
        }
 
-       schannel_auth = talloc_zero(p, struct schannel_state);
+       schannel_auth = netsec_create_state(p, creds, false /* not initiator */);
+       TALLOC_FREE(creds);
        if (!schannel_auth) {
-               TALLOC_FREE(creds);
                return False;
        }
 
-       schannel_auth->state = SCHANNEL_STATE_START;
-       schannel_auth->initiator = false;
-       schannel_auth->creds = creds;
-
        /*
         * JRA. Should we also copy the schannel session key into the pipe session key p->session_key
         * here ? We do that for NTLMSSP, but the session key is already set up from the vuser