summaryrefslogtreecommitdiff
path: root/scheduler
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2019-07-16 09:16:22 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2019-07-16 09:16:22 -0400
commit3c27d2a6ddf50a4cb02c0b7a464eaf7b6f1ea601 (patch)
treea9fa7c030e266ca1900b8e68bf439a1110446b8e /scheduler
parente9a4e9d6ea96a93d0b5df2f43b2de087d55b573f (diff)
downloadcups-3c27d2a6ddf50a4cb02c0b7a464eaf7b6f1ea601.tar.gz
Always check the group membership list (Issue #5613)
Diffstat (limited to 'scheduler')
-rw-r--r--scheduler/auth.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/scheduler/auth.c b/scheduler/auth.c
index c910c131d..5bb80edc9 100644
--- a/scheduler/auth.c
+++ b/scheduler/auth.c
@@ -1166,7 +1166,23 @@ cupsdCheckGroup(
groupid = group->gr_gid;
+ for (i = 0; group->gr_mem[i]; i ++)
+ {
+ /*
+ * User appears in the group membership...
+ */
+
+ if (!_cups_strcasecmp(username, group->gr_mem[i]))
+ return (1);
+ }
+
#ifdef HAVE_GETGROUPLIST
+ /*
+ * If the user isn't in the group membership list, try the results from
+ * getgrouplist() which is supposed to return the full list of groups a user
+ * belongs to...
+ */
+
if (user)
{
int ngroups; /* Number of groups */
@@ -1187,13 +1203,6 @@ cupsdCheckGroup(
if ((int)groupid == (int)groups[i])
return (1);
}
-
-#else
- for (i = 0; group->gr_mem[i]; i ++)
- {
- if (!_cups_strcasecmp(username, group->gr_mem[i]))
- return (1);
- }
#endif /* HAVE_GETGROUPLIST */
}
else