mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
s3:auth: Fix user_in_list() for UNIX groups
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15041 Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Thu Apr 7 09:49:44 UTC 2022 on sn-devel-184
This commit is contained in:
parent
af8747a28b
commit
6dc463d3e2
@ -1 +0,0 @@
|
||||
samba3.blackbox.smbclient_usernamemap.jacknomapper
|
@ -143,11 +143,11 @@ bool user_in_list(TALLOC_CTX *ctx, const char *user, const char * const *list)
|
||||
return false;
|
||||
}
|
||||
|
||||
DBG_DEBUG("Checking user %s in list\n", user);
|
||||
|
||||
while (*list) {
|
||||
const char *p = *list;
|
||||
bool ok;
|
||||
bool check_unix_group = false;
|
||||
|
||||
DBG_DEBUG("Checking user '%s' in list '%s'.\n", user, *list);
|
||||
|
||||
/* Check raw username */
|
||||
if (strequal(user, p)) {
|
||||
@ -155,11 +155,13 @@ bool user_in_list(TALLOC_CTX *ctx, const char *user, const char * const *list)
|
||||
}
|
||||
|
||||
while (*p == '@' || *p == '&' || *p == '+') {
|
||||
if (*p == '@' || *p == '+') {
|
||||
check_unix_group = true;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
|
||||
ok = user_in_group(user, p);
|
||||
if (ok) {
|
||||
if (check_unix_group && user_in_group(user, p)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user