diff options
author | Volker Lendecke <vl@samba.org> | 2010-08-16 08:00:48 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-08-17 22:52:03 +0200 |
commit | 26ff85893437c2c762972ed2eb542c6cfe1bb049 (patch) | |
tree | b92a2d6e18f607ad34ce90022bb811fa3517fabf /source3 | |
parent | f8ecec21e2c4451fe892885cfc12afa98a8c14f6 (diff) | |
download | samba-26ff85893437c2c762972ed2eb542c6cfe1bb049.tar.gz samba-26ff85893437c2c762972ed2eb542c6cfe1bb049.tar.bz2 samba-26ff85893437c2c762972ed2eb542c6cfe1bb049.zip |
s3: Remove smbd_server_fd() from session_claim
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/smbd/password.c | 2 | ||||
-rw-r--r-- | source3/smbd/session.c | 9 | ||||
-rw-r--r-- | source3/smbd/smb2_sesssetup.c | 6 |
4 files changed, 9 insertions, 10 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 8e4c3111b5..fe9dec41db 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5812,7 +5812,7 @@ void close_cnum(connection_struct *conn, uint16 vuid); /* The following definitions come from smbd/session.c */ bool session_init(void); -bool session_claim(struct server_id pid, user_struct *vuser); +bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser); void session_yield(user_struct *vuser); int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list); diff --git a/source3/smbd/password.c b/source3/smbd/password.c index f0989e6ac7..afe4f1b91f 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -303,7 +303,7 @@ int register_existing_vuid(struct smbd_server_connection *sconn, "and will be vuid %u\n", (int)vuser->server_info->utok.uid, vuser->server_info->unix_name, vuser->vuid)); - if (!session_claim(sconn_server_id(sconn), vuser)) { + if (!session_claim(sconn, vuser)) { DEBUG(1, ("register_existing_vuid: Failed to claim session " "for vuid=%d\n", vuser->vuid)); diff --git a/source3/smbd/session.c b/source3/smbd/session.c index 92742384bf..6f50551dd1 100644 --- a/source3/smbd/session.c +++ b/source3/smbd/session.c @@ -33,8 +33,9 @@ called when a session is created ********************************************************************/ -bool session_claim(struct server_id pid, user_struct *vuser) +bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser) { + struct server_id pid = sconn_server_id(sconn); TDB_DATA data; int i = 0; struct sessionid sessionid; @@ -131,9 +132,9 @@ bool session_claim(struct server_id pid, user_struct *vuser) client_name() handles this case internally. */ - hostname = client_name(smbd_server_fd()); + hostname = client_name(sconn->sock); if (strcmp(hostname, "UNKNOWN") == 0) { - hostname = client_addr(smbd_server_fd(),addr,sizeof(addr)); + hostname = client_addr(sconn->sock, addr, sizeof(addr)); } fstrcpy(sessionid.username, vuser->server_info->unix_name); @@ -144,7 +145,7 @@ bool session_claim(struct server_id pid, user_struct *vuser) sessionid.gid = vuser->server_info->utok.gid; fstrcpy(sessionid.remote_machine, get_remote_machine_name()); fstrcpy(sessionid.ip_addr_str, - client_addr(smbd_server_fd(),addr,sizeof(addr))); + client_addr(sconn->sock, addr, sizeof(addr))); sessionid.connect_start = time(NULL); if (!smb_pam_claim_session(sessionid.username, sessionid.id_str, diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index c51a0fd039..8fc52b2599 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -467,8 +467,7 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session, register_homes_share(session->server_info->unix_name); } - if (!session_claim(sconn_server_id(session->sconn), - session->compat_vuser)) { + if (!session_claim(session->sconn, session->compat_vuser)) { DEBUG(1, ("smb2: Failed to claim session " "for vuid=%d\n", session->compat_vuser->vuid)); @@ -678,8 +677,7 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s register_homes_share(session->server_info->unix_name); } - if (!session_claim(sconn_server_id(session->sconn), - session->compat_vuser)) { + if (!session_claim(session->sconn, session->compat_vuser)) { DEBUG(1, ("smb2: Failed to claim session " "for vuid=%d\n", session->compat_vuser->vuid)); |