File cups-branch-2.2-commit-3e4dd41459dabc5d18edbe06eb5b81291885204b.diff of Package cups.29369

commit 7a31ef60cee5f9561435503b670ea227c7d5065c Mon Sep 17 00:00:00 2001
Author: Michael R Sweet <michael.r.sweet@gmail.com>
Date: Wed, 5 Dec 2018 12:18:19 -0500

    Fix handling of MaxJobTime 0 (Issue #5438)

---
 scheduler/job.c      | 4 +++-
 scheduler/printers.c | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/scheduler/job.c b/scheduler/job.c
index 86e75e65c..a6f094ace 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -5102,8 +5102,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 bb99907ad..68239d85d 100644
--- a/scheduler/printers.c
+++ b/scheduler/printers.c
@@ -3370,7 +3370,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))
-- 
2.37.1

openSUSE Build Service is sponsored by