From ee6ee96af2cf6a5bf2b825883a9cb5f2ff64de5b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 14 Jun 2008 16:46:25 +0200 Subject: Group the access checks together in check_user_ok() (This used to be commit 45662b5e8b3c7bc39cb33c5d7deb7e9a91f30a8b) --- source3/smbd/uid.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index af992d7aee..54caca9405 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -66,6 +66,7 @@ static bool check_user_ok(connection_struct *conn, user_struct *vuser,int snum) unsigned int i; struct vuid_cache_entry *ent = NULL; bool readonly_share; + bool admin_user; for (i=0; ivuid_cache.array[i]; @@ -105,6 +106,12 @@ static bool check_user_ok(connection_struct *conn, user_struct *vuser,int snum) return False; } + admin_user = token_contains_name_in_list( + vuser->server_info->unix_name, + pdb_get_domain(vuser->server_info->sam_account), + NULL, vuser->server_info->ptok, + lp_admin_users(snum)); + ent = &conn->vuid_cache.array[conn->vuid_cache.next_entry]; conn->vuid_cache.next_entry = @@ -128,12 +135,7 @@ static bool check_user_ok(connection_struct *conn, user_struct *vuser,int snum) ent->vuid = vuser->vuid; ent->read_only = readonly_share; - - ent->admin_user = token_contains_name_in_list( - vuser->server_info->unix_name, - pdb_get_domain(vuser->server_info->sam_account), - NULL, vuser->server_info->ptok, - lp_admin_users(snum)); + ent->admin_user = admin_user; conn->read_only = ent->read_only; conn->admin_user = ent->admin_user; -- cgit