]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add missing Set-Printer-Attributes policy.
authorMichael R Sweet <msweet@msweet.org>
Sun, 26 Jul 2026 22:44:47 +0000 (18:44 -0400)
committerMichael R Sweet <msweet@msweet.org>
Sun, 26 Jul 2026 22:44:47 +0000 (18:44 -0400)
scheduler/conf.c

index cc00742cba05894efbfe6ca8f719f20597baa9be..023bde4995651fd5435925853443aa603bd2d047 100644 (file)
@@ -4566,6 +4566,25 @@ set_policy_defaults(cupsd_policy_t *pol)/* I - Policy */
        cupsdLogMessage(CUPSD_LOG_WARN, "No limit for Close-Job defined in policy %s and no suitable template found.", pol->name);
     }
 
+    if ((op = cupsdFindPolicyOp(pol, IPP_OP_SET_PRINTER_ATTRIBUTES)) == NULL ||
+       op->op == IPP_ANY_OPERATION)
+    {
+      if ((op = cupsdFindPolicyOp(pol, IPP_OP_CUPS_ADD_MODIFY_PRINTER)) != NULL &&
+         op->op != IPP_ANY_OPERATION)
+      {
+       /*
+       * Add a new limit for Set-Printer-Attribures using the
+       * CUPS-Add-Modify-Printer limit as a template...
+       */
+
+       cupsdLogMessage(CUPSD_LOG_WARN, "No limit for Set-Printer-Attributes defined in policy %s - using CUPS-Add-Modify-Printers's policy.", pol->name);
+
+       cupsdAddPolicyOp(pol, op, IPP_OP_SET_PRINTER_ATTRIBUTES);
+      }
+      else
+       cupsdLogMessage(CUPSD_LOG_WARN, "No limit for Set-Printer-Attributes defined in policy %s and no suitable template found.", pol->name);
+    }
+
     if ((op = cupsdFindPolicyOp(pol, IPP_OP_CUPS_GET_DOCUMENT)) == NULL ||
        op->op == IPP_ANY_OPERATION)
     {