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/password.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source3/smbd/password.c') diff --git a/source3/smbd/password.c b/source3/smbd/password.c index f32989da54..fb88fd3319 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -284,9 +284,12 @@ int register_existing_vuid(struct smbd_server_connection *sconn, vuser->session_info->sanitized_username = talloc_strdup( vuser->session_info, tmp); + /* Make clear that we require the optional unix_token in the source3 code */ + SMB_ASSERT(vuser->session_info->unix_token); + DEBUG(10,("register_existing_vuid: (%u,%u) %s %s %s guest=%d\n", - (unsigned int)vuser->session_info->utok.uid, - (unsigned int)vuser->session_info->utok.gid, + (unsigned int)vuser->session_info->unix_token->uid, + (unsigned int)vuser->session_info->unix_token->gid, vuser->session_info->unix_name, vuser->session_info->sanitized_username, vuser->session_info->info3->base.domain.string, @@ -302,8 +305,11 @@ int register_existing_vuid(struct smbd_server_connection *sconn, goto fail; } + /* Make clear that we require the optional unix_token in the source3 code */ + SMB_ASSERT(vuser->session_info->unix_token); + DEBUG(3,("register_existing_vuid: UNIX uid %d is UNIX user %s, " - "and will be vuid %u\n", (int)vuser->session_info->utok.uid, + "and will be vuid %u\n", (int)vuser->session_info->unix_token->uid, vuser->session_info->unix_name, vuser->vuid)); if (!session_claim(sconn, vuser)) { -- cgit