summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2010-07-16 19:44:22 -0400
committerAndrew Bartlett <abartlet@samba.org>2010-07-19 14:20:04 +1000
commitc09dcb903cdc1a68f71e892501a450df31367a54 (patch)
tree7c7938d79d20e66f8274030aabf79a30c9d39320 /source3/smbd
parent673fcfa3775ac6bdc467dde0bcf6670966cab50c (diff)
downloadsamba-c09dcb903cdc1a68f71e892501a450df31367a54.tar.gz
samba-c09dcb903cdc1a68f71e892501a450df31367a54.tar.bz2
samba-c09dcb903cdc1a68f71e892501a450df31367a54.zip
s3-auth: Use talloc hierarchies to properly free auth_ntlmssp_state contexts
Turn auth_ntlmssp_end into a destructor and attach it to auth_ntlmssp_state. Remote auth_ntlmssp_end and use TALLOC_FREE in the callers. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/password.c2
-rw-r--r--source3/smbd/seal.c2
-rw-r--r--source3/smbd/sesssetup.c4
-rw-r--r--source3/smbd/smb2_sesssetup.c18
4 files changed, 13 insertions, 13 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 2bd333ab30..996417b51e 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -120,7 +120,7 @@ void invalidate_vuid(struct smbd_server_connection *sconn, uint16 vuid)
session_yield(vuser);
if (vuser->auth_ntlmssp_state) {
- auth_ntlmssp_end(&vuser->auth_ntlmssp_state);
+ TALLOC_FREE(vuser->auth_ntlmssp_state);
}
DLIST_REMOVE(sconn->smb1.sessions.validated_users, vuser);
diff --git a/source3/smbd/seal.c b/source3/smbd/seal.c
index 171e809b44..ad785a4588 100644
--- a/source3/smbd/seal.c
+++ b/source3/smbd/seal.c
@@ -101,7 +101,7 @@ static void destroy_auth_ntlmssp(struct smb_srv_trans_enc_ctx *ec)
*/
if (ec->auth_ntlmssp_state) {
- auth_ntlmssp_end(&ec->auth_ntlmssp_state);
+ TALLOC_FREE(ec->auth_ntlmssp_state);
/* The auth_ntlmssp_end killed this already. */
ec->es->s.ntlmssp_state = NULL;
}
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 525bcafd09..27eb4f6c48 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -708,7 +708,7 @@ static void reply_spnego_ntlmssp(struct smb_request *req,
if (!NT_STATUS_EQUAL(nt_status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
/* NB. This is *NOT* an error case. JRA */
if (do_invalidate) {
- auth_ntlmssp_end(auth_ntlmssp_state);
+ TALLOC_FREE(*auth_ntlmssp_state);
if (!NT_STATUS_IS_OK(nt_status)) {
/* Kill the intermediate vuid */
invalidate_vuid(sconn, vuid);
@@ -828,7 +828,7 @@ static void reply_spnego_negotiate(struct smb_request *req,
#endif
if (*auth_ntlmssp_state) {
- auth_ntlmssp_end(auth_ntlmssp_state);
+ TALLOC_FREE(*auth_ntlmssp_state);
}
if (kerb_mech) {
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 493e74802d..4d0f03259b 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -550,7 +550,7 @@ static NTSTATUS smbd_smb2_spnego_negotiate(struct smbd_smb2_session *session,
NTSTATUS status;
/* Ensure we have no old NTLM state around. */
- auth_ntlmssp_end(&session->auth_ntlmssp_state);
+ TALLOC_FREE(session->auth_ntlmssp_state);
status = parse_spnego_mechanisms(in_security_buffer,
&secblob_in, &kerb_mech);
@@ -621,7 +621,7 @@ static NTSTATUS smbd_smb2_spnego_negotiate(struct smbd_smb2_session *session,
if (!NT_STATUS_IS_OK(status) &&
!NT_STATUS_EQUAL(status,
NT_STATUS_MORE_PROCESSING_REQUIRED)) {
- auth_ntlmssp_end(&session->auth_ntlmssp_state);
+ TALLOC_FREE(session->auth_ntlmssp_state);
TALLOC_FREE(session);
}
return status;
@@ -653,7 +653,7 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s
session->compat_vuser = talloc_zero(session, user_struct);
if (session->compat_vuser == NULL) {
- auth_ntlmssp_end(&session->auth_ntlmssp_state);
+ TALLOC_FREE(session->auth_ntlmssp_state);
TALLOC_FREE(session);
return NT_STATUS_NO_MEMORY;
}
@@ -682,7 +682,7 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s
DEBUG(1, ("smb2: Failed to claim session "
"for vuid=%d\n",
session->compat_vuser->vuid));
- auth_ntlmssp_end(&session->auth_ntlmssp_state);
+ TALLOC_FREE(session->auth_ntlmssp_state);
TALLOC_FREE(session);
return NT_STATUS_LOGON_FAILURE;
}
@@ -793,7 +793,7 @@ static NTSTATUS smbd_smb2_spnego_auth(struct smbd_smb2_session *session,
if (!NT_STATUS_IS_OK(status) &&
!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
- auth_ntlmssp_end(&session->auth_ntlmssp_state);
+ TALLOC_FREE(session->auth_ntlmssp_state);
data_blob_free(&auth);
TALLOC_FREE(session);
return status;
@@ -808,7 +808,7 @@ static NTSTATUS smbd_smb2_spnego_auth(struct smbd_smb2_session *session,
secblob_out.data,
secblob_out.length);
if (secblob_out.data && out_security_buffer->data == NULL) {
- auth_ntlmssp_end(&session->auth_ntlmssp_state);
+ TALLOC_FREE(session->auth_ntlmssp_state);
TALLOC_FREE(session);
return NT_STATUS_NO_MEMORY;
}
@@ -858,7 +858,7 @@ static NTSTATUS smbd_smb2_raw_ntlmssp_auth(struct smbd_smb2_session *session,
secblob_out.data,
secblob_out.length);
if (secblob_out.data && out_security_buffer->data == NULL) {
- auth_ntlmssp_end(&session->auth_ntlmssp_state);
+ TALLOC_FREE(session->auth_ntlmssp_state);
TALLOC_FREE(session);
return NT_STATUS_NO_MEMORY;
}
@@ -872,7 +872,7 @@ static NTSTATUS smbd_smb2_raw_ntlmssp_auth(struct smbd_smb2_session *session,
status = setup_ntlmssp_server_info(session, status);
if (!NT_STATUS_IS_OK(status)) {
- auth_ntlmssp_end(&session->auth_ntlmssp_state);
+ TALLOC_FREE(session->auth_ntlmssp_state);
TALLOC_FREE(session);
return status;
}
@@ -971,7 +971,7 @@ static NTSTATUS smbd_smb2_session_setup(struct smbd_smb2_request *smb2req,
/* Unknown packet type. */
DEBUG(1,("Unknown packet type %u in smb2 sessionsetup\n",
(unsigned int)in_security_buffer.data[0] ));
- auth_ntlmssp_end(&session->auth_ntlmssp_state);
+ TALLOC_FREE(session->auth_ntlmssp_state);
TALLOC_FREE(session);
return NT_STATUS_LOGON_FAILURE;
}