Skip to content

Commit 3f2d8f6

Browse files
committed
Fix unauthenticated print policies (Issue #1557)
1 parent 00bd189 commit 3f2d8f6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scheduler/auth.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,8 +2004,8 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */
20042004
name;
20052005
name = (char *)cupsArrayNext(best->names))
20062006
{
2007-
if (!_cups_strcasecmp(name, "@OWNER") && owner && pw &&
2008-
!strcmp(pw->pw_name, ownername))
2007+
if (!_cups_strcasecmp(name, "@OWNER") && owner && ((pw &&
2008+
!strcmp(pw->pw_name, ownername)) || (!pw && type == CUPSD_AUTH_NONE && !_cups_strcasecmp(username, ownername))))
20092009
return (HTTP_STATUS_OK);
20102010
else if (!_cups_strcasecmp(name, "@SYSTEM"))
20112011
{
@@ -2019,6 +2019,8 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */
20192019
}
20202020
else if (pw && !strcmp(pw->pw_name, name))
20212021
return (HTTP_STATUS_OK);
2022+
else if (!pw && type == CUPSD_AUTH_NONE && !_cups_strcasecmp(username, name))
2023+
return (HTTP_STATUS_OK);
20222024
}
20232025

20242026
for (name = (char *)cupsArrayFirst(best->names);

0 commit comments

Comments
 (0)