summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Cabrero <scabrero@samba.org>2022-06-03 14:01:36 +0200
committerJule Anger <janger@samba.org>2022-06-12 09:19:16 +0000
commit16df1ed429d8d36ba7eeb39c6020b65160036b4d (patch)
tree7f23c425e4c82adaeebe309375fe3f3062081434
parent56eca407415dd7c69cde7e66f02f0c95d419721a (diff)
downloadsamba-16df1ed429d8d36ba7eeb39c6020b65160036b4d.tar.gz
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 <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit dbf3d217e3424fae64d9bd00e4762dc4d2bda6c2)
-rw-r--r--source3/auth/user_util.c12
1 files changed, 5 insertions, 7 deletions
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;
}