Skip to content

Commit

Permalink
Fix policy limits using All (Issue #5296)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Apr 17, 2018
1 parent 4440da1 commit 417d0e1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Changes in CUPS v2.2.8
(Issue #5290)
- Added a workaround for certain web browsers that do not support multiple
authentication schemes in a single response header (Issue #5289)
- Fixed policy limits containing the `All` operation (Issue #5296)
- Fax queues did not support pause (p) or wait-for-dialtone (w) characters
(rdar://39212256)
- Fixed a parsing bug in the new authentication code.
Expand Down
36 changes: 23 additions & 13 deletions scheduler/conf.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Configuration routines for the CUPS scheduler.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
Expand Down Expand Up @@ -1481,13 +1481,25 @@ cupsdReadConfiguration(void)
}
}

cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdReadConfiguration: NumPolicies=%d",
cupsArrayCount(Policies));
for (i = 0, p = (cupsd_policy_t *)cupsArrayFirst(Policies);
p;
i ++, p = (cupsd_policy_t *)cupsArrayNext(Policies))
cupsdLogMessage(CUPSD_LOG_DEBUG2,
"cupsdReadConfiguration: Policies[%d]=\"%s\"", i, p->name);
if (LogLevel >= CUPSD_LOG_DEBUG2)
{
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdReadConfiguration: NumPolicies=%d",
cupsArrayCount(Policies));
for (i = 0, p = (cupsd_policy_t *)cupsArrayFirst(Policies);
p;
i ++, p = (cupsd_policy_t *)cupsArrayNext(Policies))
{
int j; /* Looping var */
cupsd_location_t *loc; /* Current location */

cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdReadConfiguration: Policies[%d]=\"%s\"", i, p->name);

for (j = 0, loc = (cupsd_location_t *)cupsArrayFirst(p->ops); loc; j ++, loc = (cupsd_location_t *)cupsArrayNext(p->ops))
{
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdReadConfiguration: ops[%d]=%s", j, ippOpString(loc->op));
}
}
}

/*
* If we are doing a full reload or the server root has changed, flush
Expand Down Expand Up @@ -3853,11 +3865,9 @@ read_policy(cups_file_t *fp, /* I - Configuration file */
if (num_ops < (int)(sizeof(ops) / sizeof(ops[0])))
{
if (!_cups_strcasecmp(value, "All"))
ops[num_ops] = IPP_ANY_OPERATION;
ops[num_ops ++] = IPP_ANY_OPERATION;
else if ((ops[num_ops] = ippOpValue(value)) == IPP_BAD_OPERATION)
cupsdLogMessage(CUPSD_LOG_ERROR,
"Bad IPP operation name \"%s\" on line %d of %s.",
value, linenum, ConfigurationFile);
cupsdLogMessage(CUPSD_LOG_ERROR, "Bad IPP operation name \"%s\" on line %d of %s.", value, linenum, ConfigurationFile);
else
num_ops ++;
}
Expand Down

0 comments on commit 417d0e1

Please sign in to comment.