winbindd: pass an memory context to do_ntlm_auth_with_stored_pw()
authorStefan Metzmacher <metze@samba.org>
Tue, 15 Dec 2015 08:07:33 +0000 (09:07 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 10 Mar 2016 05:52:27 +0000 (06:52 +0100)
We should avoid using NULL.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
source3/winbindd/winbindd_ccache_access.c

index 939da9b8d7e524794a39b6026f1f8d41dd11b4b8..ed0543c118c93e0760c1c5bda4eaf8ce632bb96f 100644 (file)
@@ -48,6 +48,7 @@ static NTSTATUS do_ntlm_auth_with_stored_pw(const char *username,
                                            const char *password,
                                            const DATA_BLOB initial_msg,
                                            const DATA_BLOB challenge_msg,
+                                           TALLOC_CTX *mem_ctx,
                                            DATA_BLOB *auth_msg,
                                            uint8_t session_key[16])
 {
@@ -55,7 +56,7 @@ static NTSTATUS do_ntlm_auth_with_stored_pw(const char *username,
        struct auth_generic_state *auth_generic_state = NULL;
        DATA_BLOB dummy_msg, reply, session_key_blob;
 
-       status = auth_generic_client_prepare(NULL, &auth_generic_state);
+       status = auth_generic_client_prepare(mem_ctx, &auth_generic_state);
 
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(1, ("Could not start NTLMSSP client: %s\n",
@@ -120,7 +121,7 @@ static NTSTATUS do_ntlm_auth_with_stored_pw(const char *username,
 
        /* Now we are ready to handle the server's actual response. */
        status = gensec_update(auth_generic_state->gensec_security,
-                              NULL, challenge_msg, &reply);
+                              mem_ctx, challenge_msg, &reply);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_OK)) {
                DEBUG(1, ("We didn't get a response to the challenge! [%s]\n",
                        nt_errstr(status)));
@@ -273,7 +274,7 @@ void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state)
 
        result = do_ntlm_auth_with_stored_pw(
                name_user, name_domain, entry->pass,
-               initial, challenge, &auth,
+               initial, challenge, talloc_tos(), &auth,
                state->response->data.ccache_ntlm_auth.session_key);
 
        if (!NT_STATUS_IS_OK(result)) {