From: Michael R Sweet Date: Wed, 5 Dec 2018 17:18:13 +0000 (-0500) Subject: Fix handling of MaxJobTime 0 (Issue #5438) X-Git-Tag: v2.3b6~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c7143551ab03423990c62923209363d760f925f;p=thirdparty%2Fcups.git Fix handling of MaxJobTime 0 (Issue #5438) --- diff --git a/CHANGES.md b/CHANGES.md index 908911d192..cb8758abb4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/scheduler/job.c b/scheduler/job.c index abd2d49de3..da7cb9c086 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -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; } } } diff --git a/scheduler/printers.c b/scheduler/printers.c index f168b4c1a4..ff381cdd5a 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -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))