summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2012-08-23 14:47:33 +0200
committerMichael Adam <obnox@samba.org>2012-10-19 12:14:59 +0200
commit4878769f8e6763fbb8347f2ea674c7a861d95564 (patch)
tree4561d7c93c74a0c06bb0221f835538a4cd681ebe
parent77f99ece482a11aad50219e64d231b27dbbccbba (diff)
downloadsamba-4878769f8e6763fbb8347f2ea674c7a861d95564.tar.gz
samba-4878769f8e6763fbb8347f2ea674c7a861d95564.tar.bz2
samba-4878769f8e6763fbb8347f2ea674c7a861d95564.zip
s3:smbd: pass smbXsrv_session instead of user_struct to session_claim() and session_yield()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
-rw-r--r--source3/smbd/password.c2
-rw-r--r--source3/smbd/proto.h5
-rw-r--r--source3/smbd/session.c6
-rw-r--r--source3/smbd/sesssetup.c4
-rw-r--r--source3/smbd/smb2_sesssetup.c2
5 files changed, 11 insertions, 8 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 60ab045283..3a64d1b138 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -105,7 +105,7 @@ void invalidate_vuid(struct smbd_server_connection *sconn, uint64_t vuid)
return;
}
- session_yield(vuser);
+ session_yield(vuser->session);
DLIST_REMOVE(sconn->users, vuser);
SMB_ASSERT(sconn->num_users > 0);
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index a71547678f..5f41957fc4 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -993,9 +993,10 @@ void close_cnum(connection_struct *conn, uint64_t vuid);
/* The following definitions come from smbd/session.c */
struct sessionid;
+struct smbXsrv_session;
bool session_init(void);
-bool session_claim(struct smbd_server_connection *sconn, struct user_struct *vuser);
-void session_yield(struct user_struct *vuser);
+bool session_claim(struct smbd_server_connection *sconn, struct smbXsrv_session *session);
+void session_yield(struct smbXsrv_session *session);
int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list);
/* The following definitions come from smbd/sesssetup.c */
diff --git a/source3/smbd/session.c b/source3/smbd/session.c
index e7e7570f40..c931f8b8e1 100644
--- a/source3/smbd/session.c
+++ b/source3/smbd/session.c
@@ -40,8 +40,9 @@
called when a session is created
********************************************************************/
-bool session_claim(struct smbd_server_connection *sconn, struct user_struct *vuser)
+bool session_claim(struct smbd_server_connection *sconn, struct smbXsrv_session *session)
{
+ struct user_struct *vuser = session->compat;
struct server_id pid = messaging_server_id(sconn->msg_ctx);
TDB_DATA data;
int i = 0;
@@ -194,8 +195,9 @@ bool session_claim(struct smbd_server_connection *sconn, struct user_struct *vus
called when a session is destroyed
********************************************************************/
-void session_yield(struct user_struct *vuser)
+void session_yield(struct smbXsrv_session *session)
{
+ struct user_struct *vuser = session->compat;
struct sessionid sessionid;
struct db_record *rec;
TDB_DATA value;
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 4d58e7a0be..16a71f7408 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -326,7 +326,7 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req)
register_homes_share(session_info->unix_info->unix_name);
}
- if (!session_claim(sconn, session->compat)) {
+ if (!session_claim(sconn, session)) {
DEBUG(1, ("smb1: Failed to claim session for vuid=%llu\n",
(unsigned long long)session->compat->vuid));
data_blob_free(&out_blob);
@@ -1008,7 +1008,7 @@ void reply_sesssetup_and_X(struct smb_request *req)
register_homes_share(session_info->unix_info->unix_name);
}
- if (!session_claim(sconn, session->compat)) {
+ if (!session_claim(sconn, session)) {
DEBUG(1, ("smb1: Failed to claim session for vuid=%llu\n",
(unsigned long long)session->compat->vuid));
data_blob_free(&nt_resp);
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 2599d2a63d..29253d0321 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -330,7 +330,7 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
register_homes_share(session_info->unix_info->unix_name);
}
- if (!session_claim(smb2req->sconn, session->compat)) {
+ if (!session_claim(smb2req->sconn, session)) {
DEBUG(1, ("smb2: Failed to claim session "
"for vuid=%llu\n",
(unsigned long long)session->compat->vuid));