summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2012-08-27 11:03:25 +0200
committerMichael Adam <obnox@samba.org>2012-10-19 12:14:59 +0200
commite24b1041b1f6e5b1c5a258a2cbe058f134a45ed9 (patch)
tree8a0cf684f5d840b94f4b2f50758f7aa000f48b64 /source3
parent02b9b79447be46835adf963cca14c618d0c435e6 (diff)
downloadsamba-e24b1041b1f6e5b1c5a258a2cbe058f134a45ed9.tar.gz
samba-e24b1041b1f6e5b1c5a258a2cbe058f134a45ed9.tar.bz2
samba-e24b1041b1f6e5b1c5a258a2cbe058f134a45ed9.zip
s3:smbd: initialize session->global before calling session_claim
Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/sesssetup.c40
-rw-r--r--source3/smbd/smb2_sesssetup.c14
2 files changed, 27 insertions, 27 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index cd7928de50..aad122cbc5 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -326,15 +326,6 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req)
register_homes_share(session_info->unix_info->unix_name);
}
- if (!session_claim(session)) {
- DEBUG(1, ("smb1: Failed to claim session for vuid=%llu\n",
- (unsigned long long)session->compat->vuid));
- data_blob_free(&out_blob);
- TALLOC_FREE(session);
- reply_nterror(req, NT_STATUS_LOGON_FAILURE);
- return;
- }
-
if (srv_is_signing_negotiated(sconn) &&
action == 0 &&
session->global->signing_key.length > 0)
@@ -366,6 +357,15 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req)
GENSEC_EXPIRE_TIME_INFINITY;
}
+ if (!session_claim(session)) {
+ DEBUG(1, ("smb1: Failed to claim session for vuid=%llu\n",
+ (unsigned long long)session->compat->vuid));
+ data_blob_free(&out_blob);
+ TALLOC_FREE(session);
+ reply_nterror(req, NT_STATUS_LOGON_FAILURE);
+ return;
+ }
+
status = smbXsrv_session_update(session);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("smb1: Failed to update session for vuid=%llu - %s\n",
@@ -1008,17 +1008,6 @@ void reply_sesssetup_and_X(struct smb_request *req)
register_homes_share(session_info->unix_info->unix_name);
}
- if (!session_claim(session)) {
- DEBUG(1, ("smb1: Failed to claim session for vuid=%llu\n",
- (unsigned long long)session->compat->vuid));
- data_blob_free(&nt_resp);
- data_blob_free(&lm_resp);
- TALLOC_FREE(session);
- reply_nterror(req, NT_STATUS_LOGON_FAILURE);
- END_PROFILE(SMBsesssetupX);
- return;
- }
-
if (srv_is_signing_negotiated(sconn) &&
action == 0 &&
session->global->signing_key.length > 0)
@@ -1057,6 +1046,17 @@ void reply_sesssetup_and_X(struct smb_request *req)
return;
}
+ if (!session_claim(session)) {
+ DEBUG(1, ("smb1: Failed to claim session for vuid=%llu\n",
+ (unsigned long long)session->compat->vuid));
+ data_blob_free(&nt_resp);
+ data_blob_free(&lm_resp);
+ TALLOC_FREE(session);
+ reply_nterror(req, NT_STATUS_LOGON_FAILURE);
+ END_PROFILE(SMBsesssetupX);
+ return;
+ }
+
/* current_user_info is changed on new vuid */
reload_services(sconn, conn_snum_used, true);
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 171021a258..265f802021 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -330,13 +330,6 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
register_homes_share(session_info->unix_info->unix_name);
}
- if (!session_claim(session)) {
- DEBUG(1, ("smb2: Failed to claim session "
- "for vuid=%llu\n",
- (unsigned long long)session->compat->vuid));
- return NT_STATUS_LOGON_FAILURE;
- }
-
set_current_user_info(session_info->unix_info->sanitized_username,
session_info->unix_info->unix_name,
session_info->info->domain_name);
@@ -350,6 +343,13 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
session->global->auth_session_info_seqnum;
session->global->expiration_time = gensec_expire_time(session->gensec);
+ if (!session_claim(session)) {
+ DEBUG(1, ("smb2: Failed to claim session "
+ "for vuid=%llu\n",
+ (unsigned long long)session->compat->vuid));
+ return NT_STATUS_LOGON_FAILURE;
+ }
+
status = smbXsrv_session_update(session);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("smb2: Failed to update session for vuid=%llu - %s\n",