Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions scheduler/ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3876,15 +3876,15 @@ check_quotas(cupsd_client_t *con, /* I - Client connection */
if (cupsArrayCount(p->users) == 0 && p->k_limit == 0 && p->page_limit == 0)
return (1);

if (cupsdDefaultAuthType() == CUPSD_AUTH_BEARER)
{
/*
* Handle OAuth-specific users/groups...
*/
if (cupsdDefaultAuthType() == CUPSD_AUTH_BEARER)
{
/*
* Handle OAuth-specific users/groups...
*/

for (name = (char *)cupsArrayFirst(p->users);
name;
name = (char *)cupsArrayNext(p->users))
name = (char *)cupsArrayNext(p->users))
{
if (name[0] == '@')
{
Expand All @@ -3907,7 +3907,7 @@ check_quotas(cupsd_client_t *con, /* I - Client connection */
}
}

if ((name != NULL) == p->deny_users)
if (cupsArrayCount(p->users) > 0 && (name != NULL) == p->deny_users)
{
cupsdLogClient(con, CUPSD_LOG_INFO, "Denying user \"%s\" access to printer \"%s\".", username, p->name);
return (0);
Expand Down
26 changes: 24 additions & 2 deletions scheduler/policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ cupsdGetPrivateAttrs(
if (printer && !_cups_strcasecmp(name, "@ACL"))
{
char *acl; /* Current ACL user/group */
int matched = 0; /* Whether the requester matched */

for (acl = (char *)cupsArrayFirst(printer->users);
acl;
Expand All @@ -366,7 +367,10 @@ cupsdGetPrivateAttrs(
*/

if (cupsdCheckGroup(username, pw, acl + 1))
{
matched = 1;
break;
}
}
else if (acl[0] == '#')
{
Expand All @@ -375,11 +379,29 @@ cupsdGetPrivateAttrs(
*/

if (cupsdCheckGroup(username, pw, acl))
{
matched = 1;
break;
}
}
else if ((cupsdDefaultAuthType() == CUPSD_AUTH_BEARER && !_cups_strcasecmp(username, acl)) || (cupsdDefaultAuthType() != CUPSD_AUTH_BEARER && pw && !strcmp(pw->pw_name, acl)))
break;
{
matched = 1;
break;
}
}

if (matched)
{
#ifdef DEBUG
cupsdLogMessage(CUPSD_LOG_DEBUG2,
"cupsdGetPrivateAttrs: Returning NULL.");
#endif /* DEBUG */

return (NULL);
}
else
continue; /* do not fall through to the generic '@' case */
}
else if (owner && !_cups_strcasecmp(name, "@OWNER") &&
((cupsdDefaultAuthType() == CUPSD_AUTH_BEARER && !_cups_strcasecmp(username, owner)) || (cupsdDefaultAuthType() != CUPSD_AUTH_BEARER && pw && !strcmp(pw->pw_name, owner))))
Expand All @@ -406,7 +428,7 @@ cupsdGetPrivateAttrs(
return (NULL);
}
}
else if (name[0] == '@')
else if (name[0] == '@' && _cups_strcasecmp(name, "@ACL") && _cups_strcasecmp(name, "@OWNER") && _cups_strcasecmp(name, "@SYSTEM"))
{
if (cupsdCheckGroup(username, pw, name + 1))
{
Expand Down