From: Samuel Cabrero Date: Fri, 3 Jun 2022 12:01:36 +0000 (+0200) Subject: Revert "s3:auth: Fix user_in_list() for UNIX groups" X-Git-Tag: tevent-0.13.0~468 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbf3d217e3424fae64d9bd00e4762dc4d2bda6c2;p=thirdparty%2Fsamba.git Revert "s3:auth: Fix user_in_list() for UNIX groups" This partly reverts commit 6dc463d3e2eb229df1c4f620cfcaf22ac71738d4. Reverted to allow next revert commits to apply cleanly. Do not recreate selftest/knownfail.d/usernamemap file. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15087 Signed-off-by: Samuel Cabrero Reviewed-by: Jeremy Allison --- diff --git a/source3/auth/user_util.c b/source3/auth/user_util.c index aa765c2a692..70b4f320c5e 100644 --- a/source3/auth/user_util.c +++ b/source3/auth/user_util.c @@ -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 check_unix_group = false; - - DBG_DEBUG("Checking user '%s' in list '%s'.\n", user, *list); + bool ok; /* Check raw username */ if (strequal(user, p)) { @@ -155,13 +155,11 @@ 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++; } - if (check_unix_group && user_in_group(user, p)) { + ok = user_in_group(user, p); + if (ok) { return true; }