summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/globals.h2
-rw-r--r--source3/smbd/process.c5
-rw-r--r--source3/smbd/smb2_server.c9
3 files changed, 9 insertions, 7 deletions
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index e2c763bafd3..94111b60ada 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -367,6 +367,7 @@ struct smbXsrv_connection {
* this session_table is used for SMB1 and SMB2,
*/
struct smbXsrv_session_table *session_table;
+ uint64_t last_session_id;
/*
* this tcon_table is only used for SMB1.
*/
@@ -731,7 +732,6 @@ struct smbd_server_connection {
* Set by us for CORE protocol.
*/
int max_send;
- uint64_t last_session_tag;
} sessions;
struct smb_signing_state *signing_state;
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index b8e01ba8aa7..09fe910219a 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1436,10 +1436,10 @@ static connection_struct *switch_message(uint8 type, struct smb_request *req)
}
}
- if (session_tag != sconn->smb1.sessions.last_session_tag) {
+ if (session_tag != sconn->conn->last_session_id) {
struct user_struct *vuser = NULL;
- sconn->smb1.sessions.last_session_tag = session_tag;
+ sconn->conn->last_session_id = session_tag;
if (session) {
vuser = session->compat;
}
@@ -3596,7 +3596,6 @@ void smbd_process(struct tevent_context *ev_ctx,
sconn->smb1.sessions.done_sesssetup = false;
sconn->smb1.sessions.max_send = BUFFER_SIZE;
- sconn->smb1.sessions.last_session_tag = UID_FIELD_INVALID;
if (!init_dptrs(sconn)) {
exit_server("init_dptrs() failed");
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index a3ed09bbb21..768a9c8c05a 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -1749,9 +1749,12 @@ static NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req)
return NT_STATUS_INVALID_HANDLE;
}
- set_current_user_info(session_info->unix_info->sanitized_username,
- session_info->unix_info->unix_name,
- session_info->info->domain_name);
+ if (in_session_id != req->sconn->conn->last_session_id) {
+ req->sconn->conn->last_session_id = in_session_id;
+ set_current_user_info(session_info->unix_info->sanitized_username,
+ session_info->unix_info->unix_name,
+ session_info->info->domain_name);
+ }
return NT_STATUS_OK;
}