]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix policy limits using All (Issue #5296)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 17 Apr 2018 20:54:24 +0000 (16:54 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 17 Apr 2018 20:54:24 +0000 (16:54 -0400)
CHANGES.md
scheduler/conf.c

index a5db51309c8693f14058d665a2faec2e85050335..2c81af43f0120f0c32b384dee65ed43b14826634 100644 (file)
@@ -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.
index f90bcfae94428aff42624be484c67b96231570ea..67a91e7a61b351dc069e02bd55157c213d3e4160 100644 (file)
@@ -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 ++;
        }