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 c1de912 commit 0873f68
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Changes in CUPS v2.3rc1
(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
39 changes: 25 additions & 14 deletions scheduler/conf.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* 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.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/

/*
Expand Down Expand Up @@ -1481,13 +1482,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 +3866,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 0873f68

Please sign in to comment.