From: Michael R Sweet Date: Tue, 17 Apr 2018 20:54:24 +0000 (-0400) Subject: Fix policy limits using All (Issue #5296) X-Git-Tag: v2.3b5~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0873f681e43c04972b3d6bc90bdbdedb29e6e913;p=thirdparty%2Fcups.git Fix policy limits using All (Issue #5296) --- diff --git a/CHANGES.md b/CHANGES.md index a5db51309c..2c81af43f0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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. diff --git a/scheduler/conf.c b/scheduler/conf.c index f90bcfae94..67a91e7a61 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -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. */ /* @@ -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 @@ -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 ++; }