diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-05-27 18:33:45 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-06-03 17:54:38 +0200 |
commit | 076aaf3f4264ca1966a3626c9356ee869c5d4700 (patch) | |
tree | 4e6d2a2242d6cdfcf7650313cf5fd54c4f6ee3c8 /source3/smbd | |
parent | 72f8328820a542167caba198dae23835f3c40a45 (diff) | |
download | samba-076aaf3f4264ca1966a3626c9356ee869c5d4700.tar.gz samba-076aaf3f4264ca1966a3626c9356ee869c5d4700.tar.bz2 samba-076aaf3f4264ca1966a3626c9356ee869c5d4700.zip |
s3:smbd: create a user_struct for compat in SMB2 Session Setup
metze
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/globals.h | 2 | ||||
-rw-r--r-- | source3/smbd/smb2_server.c | 2 | ||||
-rw-r--r-- | source3/smbd/smb2_sesssetup.c | 16 |
3 files changed, 19 insertions, 1 deletions
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 5bd75e767c..cd0cb4d246 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -268,6 +268,8 @@ struct smbd_smb2_session { DATA_BLOB session_key; bool do_signing; + user_struct *compat_vuser; + struct { /* an id tree used to allocate tids */ struct idr_context *idtree; diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index c32f9b9015..2be2828a13 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -59,7 +59,7 @@ static NTSTATUS smbd_initialize_smb2(struct smbd_server_connection *conn) if (conn->smb2.sessions.idtree == NULL) { return NT_STATUS_NO_MEMORY; } - conn->smb2.sessions.limit = 0x00FFFFFF; + conn->smb2.sessions.limit = 0x0000FFFE; conn->smb2.sessions.list = NULL; ret = tstream_bsd_existing_socket(conn, smbd_server_fd(), diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index be37aec04d..eb88a60420 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -243,6 +243,18 @@ static NTSTATUS smbd_smb2_session_setup(struct smbd_smb2_request *req, } session->session_key = session->server_info->user_session_key; + session->compat_vuser = talloc_zero(session, user_struct); + if (session->compat_vuser == NULL) { + TALLOC_FREE(session); + return NT_STATUS_NO_MEMORY; + } + session->compat_vuser->auth_ntlmssp_state = session->auth_ntlmssp_state; + session->compat_vuser->homes_snum = -1; + session->compat_vuser->server_info = session->server_info; + session->compat_vuser->session_keystr = NULL; + session->compat_vuser->vuid = session->vuid; + DLIST_ADD(session->conn->smb1.sessions.validated_users, session->compat_vuser); + session->status = NT_STATUS_OK; /* @@ -281,6 +293,10 @@ NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req) return NT_STATUS_ACCESS_DENIED; } + set_current_user_info(session->server_info->sanitized_username, + session->server_info->unix_name, + pdb_get_domain(session->server_info->sam_account)); + req->session = session; return NT_STATUS_OK; } |