summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-06-14 16:46:25 +0200
committerVolker Lendecke <vl@samba.org>2008-06-14 19:49:49 +0200
commitee6ee96af2cf6a5bf2b825883a9cb5f2ff64de5b (patch)
treede2a50109f5671b6fa4fbb404eb9fc96ef11cf61 /source3/smbd
parentb935f4a2dca62d197195573ed868abe657a71993 (diff)
downloadsamba-ee6ee96af2cf6a5bf2b825883a9cb5f2ff64de5b.tar.gz
samba-ee6ee96af2cf6a5bf2b825883a9cb5f2ff64de5b.tar.bz2
samba-ee6ee96af2cf6a5bf2b825883a9cb5f2ff64de5b.zip
Group the access checks together in check_user_ok()
(This used to be commit 45662b5e8b3c7bc39cb33c5d7deb7e9a91f30a8b)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/uid.c14
1 files changed, 8 insertions, 6 deletions
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; 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;