diff options
| author | Andrew Bartlett <abartlet@samba.org> | 2011-08-02 11:28:51 +1000 | 
|---|---|---|
| committer | Andrew Bartlett <abartlet@samba.org> | 2011-08-03 18:48:05 +1000 | 
| commit | 3f0b5d05b51ce5203a17ba75e212e78eb78fc9c7 (patch) | |
| tree | b1639d294190c66821e0c2c54dbed3866704304f | |
| parent | 2ed17af7f95bb8f5cbb5182352eff57a171c662c (diff) | |
| download | samba-3f0b5d05b51ce5203a17ba75e212e78eb78fc9c7.tar.gz samba-3f0b5d05b51ce5203a17ba75e212e78eb78fc9c7.tar.bz2 samba-3f0b5d05b51ce5203a17ba75e212e78eb78fc9c7.zip  | |
s3-ntlmssp Remove auth_ntlmssp_state_destructor, use the talloc tree instead
| -rw-r--r-- | source3/auth/auth_ntlmssp.c | 21 | 
1 files changed, 5 insertions, 16 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index 5845969631..c6f394f914 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -160,9 +160,14 @@ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state,  							&auth_ntlmssp_state->server_info,  							auth_ntlmssp_state->ntlmssp_state->user,  							auth_ntlmssp_state->ntlmssp_state->domain); +	} + +	if (!NT_STATUS_IS_OK(nt_status)) {  		return nt_status;  	} +	talloc_steal(auth_ntlmssp_state, auth_ntlmssp_state->server_info); +  	auth_ntlmssp_state->server_info->nss_token |= username_was_mapped;  	/* Clear out the session keys, and pass them to the caller. @@ -187,8 +192,6 @@ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state,  	return nt_status;  } -static int auth_ntlmssp_state_destructor(void *ptr); -  NTSTATUS auth_ntlmssp_prepare(const struct tsocket_address *remote_address,  			      struct auth_ntlmssp_state **auth_ntlmssp_state)  { @@ -264,24 +267,10 @@ NTSTATUS auth_ntlmssp_prepare(const struct tsocket_address *remote_address,  	ans->ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge;  	ans->ntlmssp_state->check_password = auth_ntlmssp_check_password; -	talloc_set_destructor((TALLOC_CTX *)ans, auth_ntlmssp_state_destructor); -  	*auth_ntlmssp_state = ans;  	return NT_STATUS_OK;  } -static int auth_ntlmssp_state_destructor(void *ptr) -{ -	struct auth_ntlmssp_state *ans; - -	ans = talloc_get_type(ptr, struct auth_ntlmssp_state); - -	TALLOC_FREE(ans->remote_address); -	TALLOC_FREE(ans->server_info); -	TALLOC_FREE(ans->ntlmssp_state); -	return 0; -} -  NTSTATUS auth_generic_start(struct auth_ntlmssp_state *auth_ntlmssp_state, const char *oid)  {  	if (auth_ntlmssp_state->auth_context->gensec_start_mech_by_oid) {  | 
