diff options
author | Volker Lendecke <vl@samba.org> | 2010-08-18 18:35:53 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-08-20 21:28:44 +0200 |
commit | f35811bfe074ec3c9c1f6b860b6d07d47b1cce92 (patch) | |
tree | c4598de2fc04672412fae3e2382fbb487e33c5d7 | |
parent | 5d7c27cb5b35848ff32f7c7e3f66247990c28ad1 (diff) | |
download | samba-f35811bfe074ec3c9c1f6b860b6d07d47b1cce92.tar.gz samba-f35811bfe074ec3c9c1f6b860b6d07d47b1cce92.tar.bz2 samba-f35811bfe074ec3c9c1f6b860b6d07d47b1cce92.zip |
s3: Use sconn->client_id in session_claim
-rw-r--r-- | source3/smbd/session.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/source3/smbd/session.c b/source3/smbd/session.c index 6f50551dd1..a8bb0daa3a 100644 --- a/source3/smbd/session.c +++ b/source3/smbd/session.c @@ -40,10 +40,8 @@ bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser) int i = 0; struct sessionid sessionid; fstring keystr; - const char * hostname; struct db_record *rec; NTSTATUS status; - char addr[INET6_ADDRSTRLEN]; vuser->session_keystr = NULL; @@ -132,20 +130,14 @@ bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser) client_name() handles this case internally. */ - hostname = client_name(sconn->sock); - if (strcmp(hostname, "UNKNOWN") == 0) { - hostname = client_addr(sconn->sock, addr, sizeof(addr)); - } - fstrcpy(sessionid.username, vuser->server_info->unix_name); - fstrcpy(sessionid.hostname, hostname); + fstrcpy(sessionid.hostname, sconn->client_id.name); sessionid.id_num = i; /* Only valid for utmp sessions */ sessionid.pid = pid; sessionid.uid = vuser->server_info->utok.uid; sessionid.gid = vuser->server_info->utok.gid; fstrcpy(sessionid.remote_machine, get_remote_machine_name()); - fstrcpy(sessionid.ip_addr_str, - client_addr(sconn->sock, addr, sizeof(addr))); + fstrcpy(sessionid.ip_addr_str, sconn->client_id.addr); sessionid.connect_start = time(NULL); if (!smb_pam_claim_session(sessionid.username, sessionid.id_str, |