mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
Group the access checks together in check_user_ok()
(This used to be commit 45662b5e8b3c7bc39cb33c5d7deb7e9a91f30a8b)
This commit is contained in:
parent
b935f4a2dc
commit
ee6ee96af2
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user