diff options
author | Volker Lendecke <vl@samba.org> | 2008-06-14 16:46:25 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-06-14 19:49:49 +0200 |
commit | ee6ee96af2cf6a5bf2b825883a9cb5f2ff64de5b (patch) | |
tree | de2a50109f5671b6fa4fbb404eb9fc96ef11cf61 /source3/smbd/uid.c | |
parent | b935f4a2dca62d197195573ed868abe657a71993 (diff) | |
download | samba-ee6ee96af2cf6a5bf2b825883a9cb5f2ff64de5b.tar.gz samba-ee6ee96af2cf6a5bf2b825883a9cb5f2ff64de5b.tar.xz samba-ee6ee96af2cf6a5bf2b825883a9cb5f2ff64de5b.zip |
Group the access checks together in check_user_ok()
(This used to be commit 45662b5e8b3c7bc39cb33c5d7deb7e9a91f30a8b)
Diffstat (limited to 'source3/smbd/uid.c')
-rw-r--r-- | source3/smbd/uid.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index af992d7aee2..54caca9405d 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; i<VUID_CACHE_SIZE; i++) { ent = &conn->vuid_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; |