1
0
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:
Pavel Filipenský 2022-03-25 11:11:50 +01:00 committed by Noel Power
parent af8747a28b
commit 6dc463d3e2
2 changed files with 7 additions and 6 deletions

View File

@ -1 +0,0 @@
samba3.blackbox.smbclient_usernamemap.jacknomapper

View File

@ -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;
}