]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix handling of MaxJobTime 0 (Issue #5438)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 5 Dec 2018 17:18:13 +0000 (12:18 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 5 Dec 2018 17:18:13 +0000 (12:18 -0500)
CHANGES.md
scheduler/job.c
scheduler/printers.c

index 908911d1924e29392a82f3369cb67cd84df225e3..cb8758abb4252954f6d094ebd501cb4233a58e98 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES - 2.3b6 - 2018-11-30
+CHANGES - 2.3b6 - 2018-12-05
 ============================
 
 Changes in CUPS v2.3b6
@@ -40,6 +40,7 @@ Changes in CUPS v2.3b6
 - The generated PPD files for IPP Everywhere printers did not contain the
   cupsManualCopies keyword (Issue #5433)
 - Kerberos credentials might be truncated (Issue #5435)
+- The handling of `MaxJobTime 0` did not match the documentation (Issue #5438)
 - The scheduler was being backgrounded on macOS, causing applications to spin
   (rdar://40436080)
 - The scheduler did not validate that required initial request attributes were
index abd2d49de3deff54ab81ded773371bf9f69beb62..da7cb9c086f63e83a125bf16d4856050803ca39d 100644 (file)
@@ -5157,8 +5157,10 @@ update_job(cupsd_job_t *job)             /* I - Job to check */
 
             if (cancel_after)
              job->cancel_time = time(NULL) + ippGetInteger(cancel_after, 0);
-           else
+           else if (MaxJobTime > 0)
              job->cancel_time = time(NULL) + MaxJobTime;
+           else
+             job->cancel_time = 0;
          }
         }
       }
index f168b4c1a4b378ec3bb8255eee678d3a97b84637..ff381cdd5ab7f3f5f15e9c0d693fcaf370aa5ae4 100644 (file)
@@ -3417,7 +3417,7 @@ add_printer_defaults(cupsd_printer_t *p)/* I - Printer */
                 "document-format-default", NULL, "application/octet-stream");
 
   if (!cupsGetOption("job-cancel-after", p->num_options, p->options))
-    ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+    ippAddInteger(p->attrs, IPP_TAG_PRINTER, MaxJobTime > 0 ? IPP_TAG_INTEGER : IPP_TAG_NOVALUE,
                  "job-cancel-after-default", MaxJobTime);
 
   if (!cupsGetOption("job-hold-until", p->num_options, p->options))