]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/job.c
Fix whitespace issues.
[thirdparty/cups.git] / scheduler / job.c
index 61cda44e2fea198e32f4d097d0a0ecdb525d6ade..90aaccbf85ab8e91a32b3dd7b7eee71a36055173 100644 (file)
@@ -1,10 +1,11 @@
 /*
  * Job management 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.
  */
 
 /*
@@ -3815,6 +3816,20 @@ get_options(cupsd_job_t *job,            /* I - Job */
       cupsdLogJob(job, CUPSD_LOG_DEBUG2, "After mapping finishings %s=%s", pwgppd->name, pwgppd->value);
   }
 
+ /*
+  * Map page-delivery values...
+  */
+
+  if ((attr = ippFindAttribute(job->attrs, "page-delivery", IPP_TAG_KEYWORD)) != NULL && !ippFindAttribute(job->attrs, "outputorder", IPP_TAG_ZERO))
+  {
+    const char *page_delivery = ippGetString(attr, 0, NULL);
+
+    if (!strncmp(page_delivery, "same-order", 10))
+      num_pwgppds = cupsAddOption("OutputOrder", "Normal", num_pwgppds, &pwgppds);
+    else if (!strncmp(page_delivery, "reverse-order", 13))
+      num_pwgppds = cupsAddOption("OutputOrder", "Reverse", num_pwgppds, &pwgppds);
+  }
+
  /*
   * Figure out how much room we need...
   */
@@ -4779,6 +4794,18 @@ start_job(cupsd_job_t     *job,          /* I - Job ID */
   job->profile  = cupsdCreateProfile(job->id, 0);
   job->bprofile = cupsdCreateProfile(job->id, 1);
 
+#ifdef HAVE_SANDBOX_H
+  if ((!job->profile || !job->bprofile) && UseSandboxing && Sandboxing != CUPSD_SANDBOXING_OFF)
+  {
+   /*
+    * Failure to create the sandbox profile means something really bad has
+    * happened and we need to shutdown immediately.
+    */
+
+    return;
+  }
+#endif /* HAVE_SANDBOX_H */
+
  /*
   * Create the status pipes and buffer...
   */