diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-07-26 17:20:35 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-08-03 18:48:03 +1000 |
commit | 6d7ac4f1ad364cac6266bd3e88d141a7517a7d15 (patch) | |
tree | 379f8644e55e5ac500478adac62720a35ee286d8 /source3/smbd/smb2_sesssetup.c | |
parent | 763243d6ed470d1ff5c0d1c4ab6cda227103cc15 (diff) | |
download | samba-6d7ac4f1ad364cac6266bd3e88d141a7517a7d15.tar.gz samba-6d7ac4f1ad364cac6266bd3e88d141a7517a7d15.tar.bz2 samba-6d7ac4f1ad364cac6266bd3e88d141a7517a7d15.zip |
s3-ntlmssp Add mem_ctx argument to auth_ntlmssp_update
This clarifies the lifetime of the returned token.
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source3/smbd/smb2_sesssetup.c')
-rw-r--r-- | source3/smbd/smb2_sesssetup.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index 511df8639d..320a707758 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -393,6 +393,7 @@ static NTSTATUS smbd_smb2_spnego_negotiate(struct smbd_smb2_session *session, } status = auth_ntlmssp_update(session->auth_ntlmssp_state, + talloc_tos(), secblob_in, &chal_out); } @@ -584,7 +585,7 @@ static NTSTATUS smbd_smb2_spnego_auth(struct smbd_smb2_session *session, } status = auth_ntlmssp_update(session->auth_ntlmssp_state, - auth, + talloc_tos(), auth, &auth_out); /* If status is NT_STATUS_OK then we need to get the token. * Map to guest is now internal to auth_ntlmssp */ @@ -637,7 +638,6 @@ static NTSTATUS smbd_smb2_raw_ntlmssp_auth(struct smbd_smb2_session *session, uint64_t *out_session_id) { NTSTATUS status; - DATA_BLOB secblob_out = data_blob_null; if (session->auth_ntlmssp_state == NULL) { status = auth_ntlmssp_start(session->sconn->remote_address, @@ -650,20 +650,9 @@ static NTSTATUS smbd_smb2_raw_ntlmssp_auth(struct smbd_smb2_session *session, /* RAW NTLMSSP */ status = auth_ntlmssp_update(session->auth_ntlmssp_state, + smb2req, in_security_buffer, - &secblob_out); - - if (NT_STATUS_IS_OK(status) || - NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { - *out_security_buffer = data_blob_talloc(smb2req, - secblob_out.data, - secblob_out.length); - if (secblob_out.data && out_security_buffer->data == NULL) { - TALLOC_FREE(session->auth_ntlmssp_state); - TALLOC_FREE(session); - return NT_STATUS_NO_MEMORY; - } - } + out_security_buffer); if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { *out_session_id = session->vuid; |