s4:auth/gensec/schannel: make a copy of netlogon_creds_CredentialState in the client
authorStefan Metzmacher <metze@samba.org>
Mon, 27 Feb 2012 14:18:56 +0000 (15:18 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 2 Mar 2012 06:07:10 +0000 (07:07 +0100)
This is really a copy for the lifetime of the rpc connection.

metze

source4/auth/gensec/schannel.c

index 51be445dbb327e12a81f304a4faaca736d746829..4c846c02c8f4311c94fc6d78fd3d16584c0152af 100644 (file)
@@ -73,7 +73,14 @@ static NTSTATUS schannel_update(struct gensec_security *gensec_security, TALLOC_
                        return NT_STATUS_OK;
                }
 
-               state->creds = talloc_reference(state, cli_credentials_get_netlogon_creds(gensec_security->credentials));
+               state->creds = cli_credentials_get_netlogon_creds(gensec_security->credentials);
+               if (state->creds == NULL) {
+                       return NT_STATUS_INVALID_PARAMETER_MIX;
+               }
+               state->creds = netlogon_creds_copy(state, state->creds);
+               if (state->creds == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+               }
 
                bind_schannel.MessageType = NL_NEGOTIATE_REQUEST;
 #if 0