Blame SOURCES/cups-str4591.patch

68a3ed
diff -up cups-1.6.3/scheduler/conf.c.str4591 cups-1.6.3/scheduler/conf.c
68a3ed
--- cups-1.6.3/scheduler/conf.c.str4591	2015-06-23 14:05:39.874805401 +0100
68a3ed
+++ cups-1.6.3/scheduler/conf.c	2015-06-23 14:10:38.364395201 +0100
68a3ed
@@ -1245,6 +1245,19 @@ cupsdReadConfiguration(void)
68a3ed
 
68a3ed
   cupsdUpdateEnv();
68a3ed
 
68a3ed
+  /*
68a3ed
+   * Validate the default error policy...
68a3ed
+   */
68a3ed
+
68a3ed
+  if (strcmp(ErrorPolicy, "retry-current-job") &&
68a3ed
+      strcmp(ErrorPolicy, "abort-job") &&
68a3ed
+      strcmp(ErrorPolicy, "retry-job") &&
68a3ed
+      strcmp(ErrorPolicy, "stop-printer"))
68a3ed
+  {
68a3ed
+    cupsdLogMessage(CUPSD_LOG_ALERT, "Invalid ErrorPolicy \"%s\", resetting to \"stop-printer\".", ErrorPolicy);
68a3ed
+    cupsdSetString(&ErrorPolicy, "stop-printer");
68a3ed
+  }
68a3ed
+
68a3ed
  /*
68a3ed
   * Update default paper size setting as needed...
68a3ed
   */
68a3ed
diff -up cups-1.6.3/scheduler/printers.c.str4591 cups-1.6.3/scheduler/printers.c
68a3ed
--- cups-1.6.3/scheduler/printers.c.str4591	2015-06-23 14:04:45.301229731 +0100
68a3ed
+++ cups-1.6.3/scheduler/printers.c	2015-06-23 14:10:52.717276314 +0100
68a3ed
@@ -3,7 +3,7 @@
68a3ed
  *
68a3ed
  *   Printer routines for the CUPS scheduler.
68a3ed
  *
68a3ed
- *   Copyright 2007-2012 by Apple Inc.
68a3ed
+ *   Copyright 2007-2015 by Apple Inc.
68a3ed
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
68a3ed
  *
68a3ed
  *   These coded instructions, statements, and computer programs are the
68a3ed
@@ -1303,10 +1303,17 @@ cupsdLoadAllPrinters(void)
68a3ed
     else if (!_cups_strcasecmp(line, "ErrorPolicy"))
68a3ed
     {
68a3ed
       if (value)
68a3ed
-        cupsdSetString(&p->error_policy, value);
68a3ed
+      {
68a3ed
+	if (strcmp(value, "retry-current-job") &&
68a3ed
+	    strcmp(value, "abort-job") &&
68a3ed
+	    strcmp(value, "retry-job") &&
68a3ed
+	    strcmp(value, "stop-printer"))
68a3ed
+	  cupsdLogMessage(CUPSD_LOG_ALERT, "Invalid ErrorPolicy \"%s\" on line %d or printers.conf.", ErrorPolicy, linenum);
68a3ed
+	else
68a3ed
+	  cupsdSetString(&p->error_policy, value);
68a3ed
+      }
68a3ed
       else
68a3ed
-	cupsdLogMessage(CUPSD_LOG_ERROR,
68a3ed
-	                "Syntax error on line %d of printers.conf.", linenum);
68a3ed
+	cupsdLogMessage(CUPSD_LOG_ERROR, "Syntax error on line %d of printers.conf.", linenum);
68a3ed
     }
68a3ed
     else if (!_cups_strcasecmp(line, "Attribute") && value)
68a3ed
     {