From 6d741e918f145c6ec62c22358aabc8162db108fd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 15 Jul 2011 14:59:14 +1000 Subject: s3-auth Use *unix_token rather than utok in struct auth3_session_info This brings this structure one step closer to the struct auth_session_info. A few SMB_ASSERT calls are added in some key places to ensure that this pointer is initialised, to make tracing any bugs here easier in future. NOTE: Many of the users of this structure should be reviewed, as unix and NT access checks are mixed in a way that should just be done using the NT ACL. This patch has not changed this behaviour however. Andrew Bartlett Signed-off-by: Andrew Tridgell --- source3/smbd/session.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/smbd/session.c') diff --git a/source3/smbd/session.c b/source3/smbd/session.c index 379a66ce8f..184ce1b3a5 100644 --- a/source3/smbd/session.c +++ b/source3/smbd/session.c @@ -136,12 +136,15 @@ bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser) return false; } + /* Make clear that we require the optional unix_token in the source3 code */ + SMB_ASSERT(vuser->session_info->unix_token); + fstrcpy(sessionid.username, vuser->session_info->unix_name); fstrcpy(sessionid.hostname, sconn->remote_hostname); sessionid.id_num = i; /* Only valid for utmp sessions */ sessionid.pid = pid; - sessionid.uid = vuser->session_info->utok.uid; - sessionid.gid = vuser->session_info->utok.gid; + sessionid.uid = vuser->session_info->unix_token->uid; + sessionid.gid = vuser->session_info->unix_token->gid; fstrcpy(sessionid.remote_machine, get_remote_machine_name()); fstrcpy(sessionid.ip_addr_str, raddr); sessionid.connect_start = time(NULL); -- cgit