summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2015-02-10 16:06:58 +0100
committerDidier Raboud <odyx@debian.org>2015-02-10 16:06:58 +0100
commit62420a02a4ab843629d57a600c442f252cc52890 (patch)
treef92d56029b57b3f7d179996d2470740ab360e696
parentcf96fd3e3ba78a01a422eab0dbeaa8819323b14b (diff)
parentd89410f8b328a6de5c5bf49b913699563d525bdf (diff)
Merge branch 'master-jessie'
-rw-r--r--debian/changelog24
-rw-r--r--debian/cups.triggers2
-rw-r--r--debian/patches/airprint-support.patch2
-rw-r--r--debian/patches/brother-hl-1250-quirks.patch18
-rw-r--r--debian/patches/color-management-extension.patch518
-rw-r--r--debian/patches/cupsd-idleexittimeout-systemd.patch2
-rw-r--r--debian/patches/cupsd-idleexittimeout-upstart.patch2
-rw-r--r--debian/patches/cupsd-idleexittimeout.patch14
-rw-r--r--debian/patches/cupsd-upstart-support.patch8
-rw-r--r--debian/patches/move-cupsd-conf-default-to-share.patch4
-rw-r--r--debian/patches/no-conffile-timestamp.patch6
-rw-r--r--debian/patches/pidfile.patch4
-rw-r--r--debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch4
-rw-r--r--debian/patches/series4
-rw-r--r--debian/patches/str2913-limit-Get-Jobs-replies-to-500-jobs.patch407
-rw-r--r--debian/patches/str4461-restore-access-to-logfiles.patch6
-rw-r--r--debian/patches/str4484-fix-random-crash-in-scheduler.patch219
-rw-r--r--debian/patches/systemd-optional-socket-activation.patch6
18 files changed, 293 insertions, 957 deletions
diff --git a/debian/changelog b/debian/changelog
index 57694223c..9dd2d03ea 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,27 @@
+cups (1.7.5-10) unstable; urgency=medium
+
+ * Change ppd-updaters trigger to use interest-noawait instead of interest to
+ avoid trigger cycles (Closes: #772871, #771765)
+
+ -- Didier Raboud <odyx@debian.org> Mon, 15 Dec 2014 22:22:33 +0100
+
+cups (1.7.5-9) unstable; urgency=medium
+
+ * Drop color-management patch; it got refused by upstream and is not
+ available in non-english translations (Closes: #763517, #768163)
+ * Drop the upstream patch to limit Get-Jobs replies to 500, as this triggers
+ a FTBS on mips
+
+ -- Didier Raboud <odyx@debian.org> Thu, 27 Nov 2014 20:44:45 +0100
+
+cups (1.7.5-8) unstable; urgency=medium
+
+ * Add a USB quirk fix for Brother HL-1250 (Closes: #712512)
+ * Backport upstream patch to fix random crash in TLS handling. The patch also
+ enables coredumps.(Closes: #760475, #760476)
+
+ -- Didier Raboud <odyx@debian.org> Sun, 23 Nov 2014 13:26:24 +0100
+
cups (1.7.5-7) unstable; urgency=medium
* Revert to not socket-activating CUPS (Closes: #747073)
diff --git a/debian/cups.triggers b/debian/cups.triggers
index 7c73fe166..e741a7b82 100644
--- a/debian/cups.triggers
+++ b/debian/cups.triggers
@@ -1,4 +1,4 @@
# Trigger is activated when a driver touches a file named after the binary
# package name containing proper DRIVER_REGEXP and GENNICKNAME_REGEXP shell
# variables in the /usr/share/cups/ppd-updaters/ directory
-interest /usr/share/cups/ppd-updaters
+interest-noawait /usr/share/cups/ppd-updaters
diff --git a/debian/patches/airprint-support.patch b/debian/patches/airprint-support.patch
index b7e915cb7..8c6cd4ef7 100644
--- a/debian/patches/airprint-support.patch
+++ b/debian/patches/airprint-support.patch
@@ -47,7 +47,7 @@ Last-Update: 2013-02-20
# Text files...
--- a/scheduler/printers.c
+++ b/scheduler/printers.c
-@@ -3601,7 +3601,9 @@
+@@ -3575,7 +3575,9 @@
}
else if (!_cups_strcasecmp(type->super, "image"))
{
diff --git a/debian/patches/brother-hl-1250-quirks.patch b/debian/patches/brother-hl-1250-quirks.patch
new file mode 100644
index 000000000..ab44f3539
--- /dev/null
+++ b/debian/patches/brother-hl-1250-quirks.patch
@@ -0,0 +1,18 @@
+Description: Add Brother HL-1250 usb quirks fix
+Author: Didier Raboud <odyx@debian.org>
+Bug-Debian: https://bugs.debian.org/712512
+Bug: https://www.cups.org/str.php?L4519
+Last-Update: 2014-11-04
+
+--- a/backend/org.cups.usb-quirks
++++ b/backend/org.cups.usb-quirks
+@@ -90,6 +90,9 @@
+ # Canon, Inc. MF4150 Printer, https://bugs.launchpad.net/bugs/1160638
+ 0x04a9 0x26a3 no-reattach
+
++# Brother Industries, Ltd HL-1250 Laser Printer, https://bugs.debian.org/712512
++0x04f9 0x0007 no-reattach
++
+ # Brother Industries, Ltd HL-1430 Laser Printer, https://bugs.launchpad.net/bugs/1038695
+ 0x04f9 0x001a no-reattach
+
diff --git a/debian/patches/color-management-extension.patch b/debian/patches/color-management-extension.patch
deleted file mode 100644
index 1152a4272..000000000
--- a/debian/patches/color-management-extension.patch
+++ /dev/null
@@ -1,518 +0,0 @@
-Description: Color management per queue using colord.
-Author: Joe Simon <jsimon383@gmail.com>
-Last-Update: 2014-08-29
---- a/cgi-bin/admin.c
-+++ b/cgi-bin/admin.c
-@@ -1132,6 +1132,11 @@
- IPP_TAG_BOOLEAN)) != NULL)
- cgiSetVariable("PRINTER_IS_SHARED",
- attr->values[0].boolean ? "1" : "0");
-+
-+ if ((attr = ippFindAttribute(oldinfo, "printer-is-cm-calibrating",
-+ IPP_TAG_BOOLEAN)) != NULL)
-+ cgiSetVariable("PRINTER_IS_CM_CALIBRATING",
-+ attr->values[0].boolean ? "1" : "0");
- }
-
- cgiCopyTemplateLang("modify-printer.tmpl");
-@@ -1149,6 +1154,8 @@
- #endif /* __APPLE__ */
- cgiSetVariable("printer_is_shared", "0");
-
-+ cgiSetVariable("printer_is_cm_calibrating", "0");
-+
- cgiCopyTemplateLang("add-printer.tmpl");
- }
-
-@@ -1335,6 +1342,7 @@
- * printer-info
- * ppd-name
- * device-uri
-+ * printer-is-cm-calibrating
- * printer-is-accepting-jobs
- * printer-is-shared
- * printer-state
-@@ -1395,6 +1403,10 @@
- ippAddBoolean(request, IPP_TAG_PRINTER, "printer-is-shared",
- var && (!strcmp(var, "1") || !strcmp(var, "on")));
-
-+ var = cgiGetVariable("printer_is_cm_calibrating");
-+ ippAddBoolean(request, IPP_TAG_PRINTER, "printer-is-cm-calibrating",
-+ var && (!strcmp(var, "1") || !strcmp(var, "on")));
-+
- ippAddInteger(request, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state",
- IPP_PRINTER_IDLE);
-
---- a/cups/cups.h
-+++ b/cups/cups.h
-@@ -241,6 +241,7 @@
- * @since CUPS 1.4/OS X 10.6@ */
- CUPS_PRINTER_MFP = 0x4000000, /* Printer with scanning capabilities
- * @since CUPS 1.4/OS X 10.6@ */
-+ CUPS_PRINTER_CM_OFF = 0x8000000, /* Printer is not color-managed */
- CUPS_PRINTER_OPTIONS = 0x6fffc /* ~(CLASS | REMOTE | IMPLICIT |
- * DEFAULT | FAX | REJECTING | DELETE |
- * NOT_SHARED | AUTHENTICATED |
---- a/cups/dest.c
-+++ b/cups/dest.c
-@@ -1437,6 +1437,7 @@
- "printer-defaults",
- "printer-info",
- "printer-is-accepting-jobs",
-+ "printer-is-cm-calibrating",
- "printer-is-shared",
- "printer-location",
- "printer-make-and-model",
-@@ -1544,7 +1545,8 @@
- !strcmp(attr->name, "marker-types") ||
- !strcmp(attr->name, "printer-commands") ||
- !strcmp(attr->name, "printer-info") ||
-- !strcmp(attr->name, "printer-is-shared") ||
-+ !strcmp(attr->name, "printer-info") ||
-+ !strcmp(attr->name, "printer-is-cm-calibrating") ||
- !strcmp(attr->name, "printer-make-and-model") ||
- !strcmp(attr->name, "printer-mandatory-job-attributes") ||
- !strcmp(attr->name, "printer-state") ||
-@@ -1581,7 +1583,7 @@
- break;
- }
- }
--#endif /* __APPLE__ */
-+#endif /* __APPLE__ */
- else if (!strcmp(attr->name, "printer-name") &&
- attr->value_tag == IPP_TAG_NAME)
- printer_name = attr->values[0].string.text;
---- a/cups/encode.c
-+++ b/cups/encode.c
-@@ -274,6 +274,7 @@
- { 0, "printer-error-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
- { 0, "printer-info", IPP_TAG_TEXT, IPP_TAG_PRINTER },
- { 0, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
-+ { 0, "printer-is-cm-calibrating", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
- { 0, "printer-is-shared", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
- { 0, "printer-location", IPP_TAG_TEXT, IPP_TAG_PRINTER },
- { 0, "printer-make-and-model", IPP_TAG_TEXT, IPP_TAG_PRINTER },
---- a/cups/ipp-support.c
-+++ b/cups/ipp-support.c
-@@ -1556,6 +1556,7 @@
- "printer-icons",
- "printer-info",
- "printer-is-accepting-jobs",
-+ "printer-is-cm-calibrating", /* CUPS extension */
- "printer-is-shared", /* CUPS extension */
- "printer-kind", /* IPP Paid Printing */
- "printer-location",
---- a/scheduler/classes.c
-+++ b/scheduler/classes.c
-@@ -506,6 +506,27 @@
- "Syntax error on line %d of classes.conf.",
- linenum);
- }
-+ else if (!_cups_strcasecmp(line, "CM-Calibration"))
-+ {
-+ /*
-+ * Set the initial color calibration mode state...
-+ */
-+
-+ if (value &&
-+ (!_cups_strcasecmp(value, "yes") ||
-+ !_cups_strcasecmp(value, "on") ||
-+ !_cups_strcasecmp(value, "true")))
-+ p->calibrating = 1;
-+ else if (value &&
-+ (!_cups_strcasecmp(value, "no") ||
-+ !_cups_strcasecmp(value, "off") ||
-+ !_cups_strcasecmp(value, "false")))
-+ p->calibrating = 0;
-+ else
-+ cupsdLogMessage(CUPSD_LOG_ERROR,
-+ "Syntax error on line %d of classes.conf.",
-+ linenum);
-+ }
- else if (!_cups_strcasecmp(line, "Shared"))
- {
- /*
-@@ -772,6 +793,11 @@
- else
- cupsFilePuts(fp, "Accepting No\n");
-
-+ if (pclass->calibrating)
-+ cupsFilePuts(fp, "CM-Calibration Yes\n");
-+ else
-+ cupsFilePuts(fp, "CM-Calibration No\n");
-+
- if (pclass->shared)
- cupsFilePuts(fp, "Shared Yes\n");
- else
---- a/scheduler/cups-lpd.c
-+++ b/scheduler/cups-lpd.c
-@@ -60,7 +60,8 @@
- int num_options, cups_option_t *options);
- static int get_printer(http_t *http, const char *name, char *dest,
- int destsize, cups_option_t **options,
-- int *accepting, int *shared, ipp_pstate_t *state);
-+ int *accepting, int *calibrating, int *shared,
-+ ipp_pstate_t *state);
- static int print_file(http_t *http, int id, const char *filename,
- const char *docname, const char *user,
- const char *format, int last);
-@@ -401,6 +402,7 @@
- int destsize, /* I - Size of destination buffer */
- cups_option_t **options, /* O - Printer options */
- int *accepting, /* O - printer-is-accepting-jobs value */
-+ int *calibrating, /* O - printer-is-cm-calibrating value */
- int *shared, /* O - printer-is-shared value */
- ipp_pstate_t *state) /* O - printer-state value */
- {
-@@ -419,6 +421,7 @@
- { /* Requested attributes */
- "printer-info",
- "printer-is-accepting-jobs",
-+ "printer-is-cm-calibrating",
- "printer-is-shared",
- "printer-name",
- "printer-state"
-@@ -431,6 +434,8 @@
-
- if (accepting)
- *accepting = 0;
-+ if (calibrating)
-+ *calibrating = 0;
- if (shared)
- *shared = 0;
- if (state)
-@@ -476,11 +481,12 @@
- * using the printer-info values...
- */
-
-- ipp_attribute_t *accepting_attr,/* printer-is-accepting-jobs */
-- *info_attr, /* printer-info */
-- *name_attr, /* printer-name */
-- *shared_attr, /* printer-is-shared */
-- *state_attr; /* printer-state */
-+ ipp_attribute_t *accepting_attr, /* printer-is-accepting-jobs */
-+ *calibrating_attr,/* printer-is-cm-calibrating */
-+ *info_attr, /* printer-info */
-+ *name_attr, /* printer-name */
-+ *shared_attr, /* printer-is-shared */
-+ *state_attr; /* printer-state */
-
-
- ippDelete(response);
-@@ -535,17 +541,21 @@
- * Get all of the attributes for the current printer...
- */
-
-- accepting_attr = NULL;
-- info_attr = NULL;
-- name_attr = NULL;
-- shared_attr = NULL;
-- state_attr = NULL;
-+ accepting_attr = NULL;
-+ calibrating_attr = NULL;
-+ info_attr = NULL;
-+ name_attr = NULL;
-+ shared_attr = NULL;
-+ state_attr = NULL;
-
- while (attr && attr->group_tag == IPP_TAG_PRINTER)
- {
- if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
- attr->value_tag == IPP_TAG_BOOLEAN)
- accepting_attr = attr;
-+ else if (!strcmp(attr->name, "printer-is-cm-calibrating") &&
-+ attr->value_tag == IPP_TAG_BOOLEAN)
-+ calibrating_attr = attr;
- else if (!strcmp(attr->name, "printer-info") &&
- attr->value_tag == IPP_TAG_TEXT)
- info_attr = attr;
-@@ -574,6 +584,9 @@
- if (accepting && accepting_attr)
- *accepting = accepting_attr->values[0].boolean;
-
-+ if (calibrating && calibrating_attr)
-+ *calibrating = calibrating_attr->values[0].boolean;
-+
- if (shared && shared_attr)
- *shared = shared_attr->values[0].boolean;
-
-@@ -611,6 +624,19 @@
- *accepting = attr->values[0].boolean;
- }
-
-+ if (calibrating)
-+ {
-+ if ((attr = ippFindAttribute(response, "printer-is-cm-calibrating",
-+ IPP_TAG_BOOLEAN)) == NULL)
-+ {
-+ syslog(LOG_ERR, "No printer-is-cm-calibrating attribute found in "
-+ "response from server!");
-+ *calibrating = 1;
-+ }
-+ else
-+ *calibrating = attr->values[0].boolean;
-+ }
-+
- if (shared)
- {
- if ((attr = ippFindAttribute(response, "printer-is-shared",
-@@ -643,7 +669,7 @@
-
- num_options = 0;
-
-- if (options && shared && accepting)
-+ if (options && shared && calibrating && accepting)
- {
- if ((cups_serverroot = getenv("CUPS_SERVERROOT")) == NULL)
- cups_serverroot = CUPS_SERVERROOT;
-@@ -786,6 +812,7 @@
- docname[1024], /* Document name */
- dest[256]; /* Printer/class queue */
- int accepting, /* printer-is-accepting */
-+ calibrating, /* printer-is-cm-calibrating */
- shared, /* printer-is-shared */
- num_options; /* Number of options */
- cups_option_t *options; /* Options */
-@@ -813,7 +840,7 @@
- */
-
- num_options = get_printer(http, queue, dest, sizeof(dest), &options,
-- &accepting, &shared, NULL);
-+ &accepting, &calibrating, &shared, NULL);
-
- if (num_options < 0 || !accepting || !shared)
- {
-@@ -1362,7 +1389,7 @@
- * Get the actual destination name and printer state...
- */
-
-- if (get_printer(http, queue, dest, sizeof(dest), NULL, NULL, NULL, &state))
-+ if (get_printer(http, queue, dest, sizeof(dest), NULL, NULL, NULL, NULL, &state))
- {
- syslog(LOG_ERR, "Unable to get printer %s: %s", queue,
- cupsLastErrorString());
---- a/scheduler/ipp.c
-+++ b/scheduler/ipp.c
-@@ -988,6 +988,16 @@
- pclass->accepting ? "Now" : "No longer");
- }
-
-+ if ((attr = ippFindAttribute(con->request, "printer-is-cm-calibrating",
-+ IPP_TAG_BOOLEAN)) != NULL)
-+ {
-+ cupsdLogMessage(CUPSD_LOG_INFO,
-+ "Setting %s printer-is-cm-calibrating to %d (was %d.)",
-+ pclass->name, attr->values[0].boolean, pclass->calibrating);
-+
-+ pclass->calibrating = attr->values[0].boolean;
-+ }
-+
- if ((attr = ippFindAttribute(con->request, "printer-is-shared",
- IPP_TAG_BOOLEAN)) != NULL)
- {
-@@ -2492,6 +2502,16 @@
- printer->accepting ? "Now" : "No longer");
- }
-
-+ if ((attr = ippFindAttribute(con->request, "printer-is-cm-calibrating",
-+ IPP_TAG_BOOLEAN)) != NULL)
-+ {
-+ cupsdLogMessage(CUPSD_LOG_INFO,
-+ "Setting %s printer-is-cm-calibrating to %d (was %d.)",
-+ printer->name, attr->values[0].boolean, printer->calibrating);
-+
-+ printer->calibrating = attr->values[0].boolean;
-+ }
-+
- if ((attr = ippFindAttribute(con->request, "printer-is-shared",
- IPP_TAG_BOOLEAN)) != NULL)
- {
-@@ -4950,6 +4970,10 @@
- ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-accepting-jobs",
- printer->accepting);
-
-+ if (!ra || cupsArrayFind(ra, "printer-is-cm-calibrating"))
-+ ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-cm-calibrating",
-+ printer->calibrating);
-+
- if (!ra || cupsArrayFind(ra, "printer-is-shared"))
- ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-shared",
- printer->shared);
-@@ -4999,6 +5023,9 @@
- if (!printer->accepting)
- type |= CUPS_PRINTER_REJECTING;
-
-+ if (!printer->calibrating)
-+ type |= CUPS_PRINTER_CM_OFF;
-+
- if (!printer->shared)
- type |= CUPS_PRINTER_NOT_SHARED;
-
---- a/scheduler/printers.c
-+++ b/scheduler/printers.c
-@@ -95,11 +95,12 @@
- uuid, sizeof(uuid)));
- cupsdSetDeviceURI(p, "file:///dev/null");
-
-- p->state = IPP_PRINTER_STOPPED;
-- p->state_time = time(NULL);
-- p->accepting = 0;
-- p->shared = DefaultShared;
-- p->filetype = mimeAddType(MimeDatabase, "printer", name);
-+ p->state = IPP_PRINTER_STOPPED;
-+ p->state_time = time(NULL);
-+ p->accepting = 0;
-+ p->calibrating = 0;
-+ p->shared = DefaultShared;
-+ p->filetype = mimeAddType(MimeDatabase, "printer", name);
-
- cupsdSetString(&p->job_sheets[0], "none");
- cupsdSetString(&p->job_sheets[1], "none");
-@@ -1081,6 +1082,26 @@
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Syntax error on line %d of printers.conf.", linenum);
- }
-+ else if (!_cups_strcasecmp(line, "CM-Calibration"))
-+ {
-+ /*
-+ * Set the initial color calibration mode state...
-+ */
-+
-+ if (value &&
-+ (!_cups_strcasecmp(value, "yes") ||
-+ !_cups_strcasecmp(value, "on") ||
-+ !_cups_strcasecmp(value, "true")))
-+ p->calibrating = 1;
-+ else if (value &&
-+ (!_cups_strcasecmp(value, "no") ||
-+ !_cups_strcasecmp(value, "off") ||
-+ !_cups_strcasecmp(value, "false")))
-+ p->calibrating = 0;
-+ else
-+ cupsdLogMessage(CUPSD_LOG_ERROR,
-+ "Syntax error on line %d of printers.conf.", linenum);
-+ }
- else if (!_cups_strcasecmp(line, "Type"))
- {
- if (value)
-@@ -1443,6 +1464,11 @@
- else
- cupsFilePuts(fp, "Accepting No\n");
-
-+ if (printer->calibrating)
-+ cupsFilePuts(fp, "CM-Calibration Yes\n");
-+ else
-+ cupsFilePuts(fp, "CM-Calibration No\n");
-+
- if (printer->shared)
- cupsFilePuts(fp, "Shared Yes\n");
- else
---- a/scheduler/printers.h
-+++ b/scheduler/printers.h
-@@ -69,6 +69,7 @@
- *op_policy, /* Operation policy name */
- *error_policy; /* Error policy */
- cupsd_policy_t *op_policy_ptr; /* Pointer to operation policy */
-+ int calibrating; /* Color-calibration Mode? */
- int shared; /* Shared? */
- int accepting; /* Accepting jobs? */
- int holding_new_jobs; /* Holding new jobs for printing? */
---- a/templates/add-printer.tmpl
-+++ b/templates/add-printer.tmpl
-@@ -33,6 +33,11 @@
- <TD><INPUT TYPE="HIDDEN" NAME="DEVICE_URI" VALUE="{device_uri}">{device_uri}</TD>
- </TR>
- <TR>
-+<TH CLASS="label">Color Calibration Mode:</TH>
-+<TD><INPUT TYPE="CHECKBOX" NAME="PRINTER_IS_CM_CALIBRATING" {PRINTER_IS_CM_CALIBRATING=1?CHECKED:}>
-+Enabled</TD>
-+</TR>
-+<TR>
- <TH CLASS="label">Sharing:</TH>
- <TD><INPUT TYPE="CHECKBOX" NAME="PRINTER_IS_SHARED" {PRINTER_IS_SHARED=1?CHECKED:}>
- Share This Printer</TD>
-@@ -44,4 +49,4 @@
- </TABLE>
-
- </FORM>
--</DIV>
-\ No newline at end of file
-+</DIV>
---- a/templates/choose-make.tmpl
-+++ b/templates/choose-make.tmpl
-@@ -25,6 +25,10 @@
- <TD><INPUT TYPE="HIDDEN" NAME="PRINTER_LOCATION" VALUE="{printer_location}">{printer_location}</TD>
- </TR>
- <TR>
-+<TH CLASS="label">Color Calibration Mode:</TH>
-+<TD><INPUT TYPE="HIDDEN" NAME="PRINTER_IS_CM_CALIBRATING" VALUE="{?printer_is_cm_calibrating}">{?printer_is_cm_calibrating=?Not:{?printer_is_cm_calibrating=0?Not:}} Enabled</TD>
-+</TR>
-+<TR>
- <TH CLASS="label">Connection:</TH>
- <TD><INPUT TYPE="HIDDEN" NAME="DEVICE_URI" VALUE="{device_uri}">{device_uri}</TD>
- </TR>
-@@ -61,4 +65,4 @@
- </TABLE>
-
- </FORM>
--</DIV>
-\ No newline at end of file
-+</DIV>
---- a/templates/choose-model.tmpl
-+++ b/templates/choose-model.tmpl
-@@ -24,6 +24,10 @@
- <TD><INPUT TYPE="HIDDEN" NAME="PRINTER_LOCATION" VALUE="{printer_location}">{printer_location}</TD>
- </TR>
- <TR>
-+<TH CLASS="label">Color Calibration Mode:</TH>
-+<TD><INPUT TYPE="HIDDEN" NAME="PRINTER_IS_CM_CALIBRATING" VALUE="{?printer_is_cm_calibrating}">{?printer_is_cm_calibrating=?Not:{?printer_is_cm_calibrating=0?Not:}} Enabled</TD>
-+</TR>
-+<TR>
- <TH CLASS="label">Connection:</TH>
- <TD><INPUT TYPE="HIDDEN" NAME="DEVICE_URI" VALUE="{device_uri}">{device_uri}</TD>
- </TR>
-@@ -57,4 +61,4 @@
- </TABLE>
-
- </FORM>
--</DIV>
-\ No newline at end of file
-+</DIV>
---- a/templates/modify-printer.tmpl
-+++ b/templates/modify-printer.tmpl
-@@ -27,12 +27,16 @@
- <TD><INPUT TYPE="HIDDEN" NAME="DEVICE_URI" VALUE="{device_uri}">{device_uri}</TD>
- </TR>
- <TR>
-+<TH CLASS="label">Color Calibration Mode:</TH>
-+<TD><INPUT TYPE="CHECKBOX" NAME="PRINTER_IS_CM_CALIBRATING" {PRINTER_IS_CM_CALIBRATING=1?CHECKED:}>
-+Enabled</TD>
-+</TR>
-+<TR>
- <TH CLASS="label">Sharing:</TH>
- <TD><INPUT TYPE="CHECKBOX" NAME="PRINTER_IS_SHARED" {PRINTER_IS_SHARED=1?CHECKED:}>
- Share This Printer</TD>
- </TR>
- <TR>
--<TR>
- <TD></TD>
- <TD><INPUT TYPE="SUBMIT" VALUE="Continue"></TD>
- </TR>
---- a/templates/printer.tmpl
-+++ b/templates/printer.tmpl
-@@ -3,7 +3,7 @@
- <H2 CLASS="title"><A HREF="{printer_uri_supported}">{printer_name}</A>
- ({printer_state=3?Idle:{printer_state=4?Processing:Paused}},
- {printer_is_accepting_jobs=0?Rejecting Jobs:Accepting Jobs},
--{server_is_sharing_printers=0?Not:{printer_is_shared=0?Not:}} Shared{default_name={printer_name}?, Server Default:})</H2>
-+{server_is_sharing_printers=0?Not:{printer_is_shared=0?Not:}} Shared{default_name={printer_name}?, Server Default:} {printer_is_cm_calibrating=1?, Not Color-Managed:})</H2>
-
- <FORM METHOD="POST" ACTION="{printer_uri_supported}" NAME="maintenance">
- <INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
-@@ -44,4 +44,4 @@
- {sides_default?sides={sides_default}:}</TD></TR>
- </TABLE>
-
--</DIV>
-\ No newline at end of file
-+</DIV>
diff --git a/debian/patches/cupsd-idleexittimeout-systemd.patch b/debian/patches/cupsd-idleexittimeout-systemd.patch
index 95ffbd364..4abc692a7 100644
--- a/debian/patches/cupsd-idleexittimeout-systemd.patch
+++ b/debian/patches/cupsd-idleexittimeout-systemd.patch
@@ -33,7 +33,7 @@ Last-Update: 2014-10-23
/* Time after which an idle cupsd will exit */
--- a/scheduler/main.c
+++ b/scheduler/main.c
-@@ -1728,6 +1728,15 @@
+@@ -1736,6 +1736,15 @@
# endif /* HAVE_SSL */
}
diff --git a/debian/patches/cupsd-idleexittimeout-upstart.patch b/debian/patches/cupsd-idleexittimeout-upstart.patch
index 23e8a8eaa..18d96e45a 100644
--- a/debian/patches/cupsd-idleexittimeout-upstart.patch
+++ b/debian/patches/cupsd-idleexittimeout-upstart.patch
@@ -4,7 +4,7 @@ Author: Till Kamppeter <till.kamppeter@gmail.com>,
Bug: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1276713
--- a/scheduler/main.c
+++ b/scheduler/main.c
-@@ -1827,6 +1827,13 @@
+@@ -1835,6 +1835,13 @@
if (_httpAddrPort(&(lis->address)) == 443)
lis->encryption = HTTP_ENCRYPT_ALWAYS;
# endif /* HAVE_SSL */
diff --git a/debian/patches/cupsd-idleexittimeout.patch b/debian/patches/cupsd-idleexittimeout.patch
index 4c2584501..c799b3cf1 100644
--- a/debian/patches/cupsd-idleexittimeout.patch
+++ b/debian/patches/cupsd-idleexittimeout.patch
@@ -46,8 +46,8 @@ Last-Update: 2014-06-04
+ int t = -1; /* Timeout */
char *opt; /* Option character */
int fg; /* Run in the foreground */
- int fds; /* Number of ready descriptors */
-@@ -123,6 +124,8 @@
+ int close_all = 1, /* Close all file descriptors? */
+@@ -125,6 +126,8 @@
#else
time_t netif_time = 0; /* Time since last network update */
#endif /* __APPLE__ */
@@ -56,8 +56,8 @@ Last-Update: 2014-06-04
#if HAVE_LAUNCHD
int launchd_idle_exit;
/* Idle exit on select timeout? */
-@@ -288,6 +291,21 @@
- fg = 1;
+@@ -304,6 +307,21 @@
+ close_all = 0;
break;
+ case 'x' : /* Exit on idle timeout */
@@ -78,7 +78,7 @@ Last-Update: 2014-06-04
default : /* Unknown option */
_cupsLangPrintf(stderr, _("cupsd: Unknown option \"%c\" - "
"aborting."), *opt);
-@@ -533,6 +551,13 @@
+@@ -541,6 +559,13 @@
}
/*
@@ -92,7 +92,7 @@ Last-Update: 2014-06-04
* Clean out old temp files and printer cache data.
*/
-@@ -770,6 +795,26 @@
+@@ -778,6 +803,26 @@
if ((timeout = select_timeout(fds)) > 1 && LastEvent)
timeout = 1;
@@ -119,7 +119,7 @@ Last-Update: 2014-06-04
#if HAVE_LAUNCHD
/*
* If no other work is scheduled and we're being controlled by
-@@ -883,6 +928,20 @@
+@@ -891,6 +936,20 @@
}
#endif /* !__APPLE__ */
diff --git a/debian/patches/cupsd-upstart-support.patch b/debian/patches/cupsd-upstart-support.patch
index 8c6f92bc2..cb85677ba 100644
--- a/debian/patches/cupsd-upstart-support.patch
+++ b/debian/patches/cupsd-upstart-support.patch
@@ -24,7 +24,7 @@ Bug: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1276713
static void parent_handler(int sig);
static void process_children(void);
static void sigchld_handler(int sig);
-@@ -326,6 +327,14 @@
+@@ -342,6 +343,14 @@
usage(1);
}
@@ -39,7 +39,7 @@ Bug: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1276713
if (!ConfigurationFile)
cupsdSetString(&ConfigurationFile, CUPS_SERVERROOT "/cupsd.conf");
-@@ -594,6 +603,11 @@
+@@ -602,6 +611,11 @@
#endif /* HAVE_SYSTEMD */
/*
@@ -51,7 +51,7 @@ Bug: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1276713
* Startup the server...
*/
-@@ -792,6 +806,13 @@
+@@ -800,6 +814,13 @@
#endif /* HAVE_SYSTEMD */
/*
@@ -65,7 +65,7 @@ Bug: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1276713
* Startup the server...
*/
-@@ -1673,6 +1694,94 @@
+@@ -1681,6 +1702,94 @@
}
#endif /* HAVE_SYSTEMD */
diff --git a/debian/patches/move-cupsd-conf-default-to-share.patch b/debian/patches/move-cupsd-conf-default-to-share.patch
index 15193676a..bf5467e24 100644
--- a/debian/patches/move-cupsd-conf-default-to-share.patch
+++ b/debian/patches/move-cupsd-conf-default-to-share.patch
@@ -7,7 +7,7 @@ Last-Update: 2014-01-16
--- a/cgi-bin/admin.c
+++ b/cgi-bin/admin.c
-@@ -1949,6 +1949,7 @@
+@@ -1937,6 +1937,7 @@
int ch; /* Character from file */
char filename[1024]; /* Filename */
const char *server_root; /* Location of config files */
@@ -15,7 +15,7 @@ Last-Update: 2014-01-16
/*
-@@ -2032,7 +2033,10 @@
+@@ -2020,7 +2021,10 @@
* well...
*/
diff --git a/debian/patches/no-conffile-timestamp.patch b/debian/patches/no-conffile-timestamp.patch
index 16dfab8f9..f049b393a 100644
--- a/debian/patches/no-conffile-timestamp.patch
+++ b/debian/patches/no-conffile-timestamp.patch
@@ -5,7 +5,7 @@ Bug-Debian: http://bugs.debian.org/549673
--- a/scheduler/classes.c
+++ b/scheduler/classes.c
-@@ -719,7 +719,7 @@
+@@ -698,7 +698,7 @@
strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate);
cupsFilePuts(fp, "# Class configuration file for " CUPS_SVERSION "\n");
@@ -16,7 +16,7 @@ Bug-Debian: http://bugs.debian.org/549673
/*
--- a/scheduler/job.c
+++ b/scheduler/job.c
-@@ -2128,7 +2128,7 @@
+@@ -2118,7 +2118,7 @@
strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate);
cupsFilePuts(fp, "# Job cache file for " CUPS_SVERSION "\n");
@@ -27,7 +27,7 @@ Bug-Debian: http://bugs.debian.org/549673
/*
--- a/scheduler/printers.c
+++ b/scheduler/printers.c
-@@ -1370,7 +1370,7 @@
+@@ -1349,7 +1349,7 @@
strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate);
cupsFilePuts(fp, "# Printer configuration file for " CUPS_SVERSION "\n");
diff --git a/debian/patches/pidfile.patch b/debian/patches/pidfile.patch
index 4649a561d..9496ed1b9 100644
--- a/debian/patches/pidfile.patch
+++ b/debian/patches/pidfile.patch
@@ -54,7 +54,7 @@ Last-Update: 2012-11-29
/*
-@@ -688,6 +690,11 @@
+@@ -696,6 +698,11 @@
cupsdStartSystemMonitor();
#endif /* __APPLE__ */
@@ -66,7 +66,7 @@ Last-Update: 2012-11-29
/*
* Send server-started event...
*/
-@@ -1234,10 +1241,41 @@
+@@ -1242,10 +1249,41 @@
cupsdStopSelect();
diff --git a/debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch b/debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
index b7322ef1d..1c36e888f 100644
--- a/debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
+++ b/debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
@@ -11,7 +11,7 @@ Bug: https://www.cups.org/str.php?L4344
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
-@@ -8381,6 +8381,11 @@
+@@ -8249,6 +8249,11 @@
ipp_attribute_t *attr, /* Current attribute */
*attr2, /* Job attribute */
*prev2; /* Previous job attribute */
@@ -23,7 +23,7 @@ Bug: https://www.cups.org/str.php?L4344
/*
-@@ -8442,6 +8447,85 @@
+@@ -8310,6 +8315,85 @@
}
/*
diff --git a/debian/patches/series b/debian/patches/series
index 349b84ae0..df153cbbe 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,8 +1,8 @@
# patches accepted and committed upstream
str4396-make-scheduler-return-completed-jobs-in-correct-order.patch
-str2913-limit-Get-Jobs-replies-to-500-jobs.patch
str4461-restore-access-to-logfiles.patch
str4475-fix-the-spinner-imager-on-restart.patch
+str4484-fix-random-crash-in-scheduler.patch
str4500-cupsGetPPD3-Only-use-symlink-if-file-is-readable-STR.patch
# patches sent upstream
@@ -13,9 +13,9 @@ fixes-for-jobs-with-multiple-files-and-multiple-formats.patch
cupsd-idleexittimeout.patch
cups-no-gcrypt.patch
canon-mx3x0-quirks.patch
+brother-hl-1250-quirks.patch
# patches which should go upstream
-color-management-extension.patch
systemd-optional-socket-activation.patch
cupsd-upstart-support.patch
# Fix tests, should probably go upstream
diff --git a/debian/patches/str2913-limit-Get-Jobs-replies-to-500-jobs.patch b/debian/patches/str2913-limit-Get-Jobs-replies-to-500-jobs.patch
deleted file mode 100644
index a9b387be2..000000000
--- a/debian/patches/str2913-limit-Get-Jobs-replies-to-500-jobs.patch
+++ /dev/null
@@ -1,407 +0,0 @@
-Description: Performance fixes for Get-Jobs (STR #2913)
- .
- Cache a few additional job attributes so that we normally do not need to load
- the job attributes from the 'c' files.
- .
- If we do need to load them, limit the returned jobs to 500 at a time.
- .
- Implement first-index operation attribute
-Bug: https://www.cups.org/str.php?L2913
-Author: Michael Sweet <msweet@apple.com>
-Last-Update: 2014-10-22
---- a/scheduler/ipp.c
-+++ b/scheduler/ipp.c
-@@ -1531,8 +1531,7 @@
- }
-
- if ((attr = ippFindAttribute(con->request, "job-name", IPP_TAG_ZERO)) == NULL)
-- ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL,
-- "Untitled");
-+ ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, "Untitled");
- else if ((attr->value_tag != IPP_TAG_NAME &&
- attr->value_tag != IPP_TAG_NAMELANG) ||
- attr->num_values != 1)
-@@ -1612,6 +1611,9 @@
- ippDeleteAttribute(job->attrs, auth_info);
- }
-
-+ if ((attr = ippFindAttribute(con->request, "job-name", IPP_TAG_NAME)) != NULL)
-+ cupsdSetString(&(job->name), attr->values[0].string.text);
-+
- if ((attr = ippFindAttribute(job->attrs, "job-originating-host-name",
- IPP_TAG_ZERO)) != NULL)
- {
-@@ -1706,8 +1708,7 @@
- ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_URI, "job-printer-uri", NULL,
- printer->uri);
-
-- if ((attr = ippFindAttribute(job->attrs, "job-k-octets",
-- IPP_TAG_INTEGER)) != NULL)
-+ if ((attr = ippFindAttribute(job->attrs, "job-k-octets", IPP_TAG_INTEGER)) != NULL)
- attr->values[0].integer = 0;
- else
- ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-k-octets", 0);
-@@ -4348,8 +4349,9 @@
-
- kbytes = (cupsFileTell(out) + 1023) / 1024;
-
-- if ((attr = ippFindAttribute(job->attrs, "job-k-octets",
-- IPP_TAG_INTEGER)) != NULL)
-+ job->koctets += kbytes;
-+
-+ if ((attr = ippFindAttribute(job->attrs, "job-k-octets", IPP_TAG_INTEGER)) != NULL)
- attr->values[0].integer += kbytes;
-
- cupsFileClose(out);
-@@ -4771,7 +4773,55 @@
- "job-uri", NULL, job_uri);
- }
-
-- copy_attrs(con->response, job->attrs, ra, IPP_TAG_JOB, 0, exclude);
-+ if (job->attrs)
-+ {
-+ copy_attrs(con->response, job->attrs, ra, IPP_TAG_JOB, 0, exclude);
-+ }
-+ else
-+ {
-+ /*
-+ * Generate attributes from the job structure...
-+ */
-+
-+ if (!ra || cupsArrayFind(ra, "job-id"))
-+ ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-id", job->id);
-+
-+ if (!ra || cupsArrayFind(ra, "job-k-octets"))
-+ ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-k-octets", job->koctets);
-+
-+ if (job->name && (!ra || cupsArrayFind(ra, "job-name")))
-+ ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, job->name);
-+
-+ if (job->username && (!ra || cupsArrayFind(ra, "job-originating-user-name")))
-+ ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_NAME, "job-originating-user-name", NULL, job->username);
-+
-+ if (!ra || cupsArrayFind(ra, "job-state"))
-+ ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_ENUM, "job-state", (int)job->state_value);
-+
-+ if (!ra || cupsArrayFind(ra, "job-state-reasons"))
-+ {
-+ switch (job->state_value)
-+ {
-+ default : /* Should never get here for processing, pending, held, or stopped jobs since they don't get unloaded... */
-+ break;
-+ case IPP_JSTATE_ABORTED :
-+ ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "job-aborted-by-system");
-+ break;
-+ case IPP_JSTATE_CANCELED :
-+ ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "job-canceled-by-user");
-+ break;
-+ case IPP_JSTATE_COMPLETED :
-+ ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "job-completed-successfully");
-+ break;
-+ }
-+ }
-+
-+ if (job->completed_time && (!ra || cupsArrayFind(ra, "time-at-completed")))
-+ ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, "time-at-completed", (int)job->completed_time);
-+
-+ if (job->completed_time && (!ra || cupsArrayFind(ra, "time-at-creation")))
-+ ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, "time-at-creation", (int)job->creation_time);
-+ }
- }
-
-
-@@ -6124,9 +6174,13 @@
- int port; /* Port portion of URI */
- int job_comparison; /* Job comparison */
- ipp_jstate_t job_state; /* job-state value */
-- int first_job_id; /* First job ID */
-- int limit; /* Maximum number of jobs to return */
-+ int first_job_id = 1, /* First job ID */
-+ first_index = 1, /* First index */
-+ current_index = 0; /* Current index */
-+ int limit = 0; /* Maximum number of jobs to return */
- int count; /* Number of jobs that match */
-+ int need_load_job = 0; /* Do we need to load the job? */
-+ const char *job_attr; /* Job attribute requested */
- ipp_attribute_t *job_ids; /* job-ids attribute */
- cupsd_job_t *job; /* Current job pointer */
- cupsd_printer_t *printer; /* Printer */
-@@ -6292,8 +6346,7 @@
- * See if they want to limit the number of jobs reported...
- */
-
-- if ((attr = ippFindAttribute(con->request, "limit",
-- IPP_TAG_INTEGER)) != NULL)
-+ if ((attr = ippFindAttribute(con->request, "limit", IPP_TAG_INTEGER)) != NULL)
- {
- if (job_ids)
- {
-@@ -6305,11 +6358,20 @@
-
- limit = attr->values[0].integer;
- }
-- else
-- limit = 0;
-
-- if ((attr = ippFindAttribute(con->request, "first-job-id",
-- IPP_TAG_INTEGER)) != NULL)
-+ if ((attr = ippFindAttribute(con->request, "first-index", IPP_TAG_INTEGER)) != NULL)
-+ {
-+ if (job_ids)
-+ {
-+ send_ipp_status(con, IPP_CONFLICT,
-+ _("The %s attribute cannot be provided with job-ids."),
-+ "first-index");
-+ return;
-+ }
-+
-+ first_index = attr->values[0].integer;
-+ }
-+ else if ((attr = ippFindAttribute(con->request, "first-job-id", IPP_TAG_INTEGER)) != NULL)
- {
- if (job_ids)
- {
-@@ -6321,15 +6383,12 @@
-
- first_job_id = attr->values[0].integer;
- }
-- else
-- first_job_id = 1;
-
- /*
- * See if we only want to see jobs for a specific user...
- */
-
-- if ((attr = ippFindAttribute(con->request, "my-jobs",
-- IPP_TAG_BOOLEAN)) != NULL && job_ids)
-+ if ((attr = ippFindAttribute(con->request, "my-jobs", IPP_TAG_BOOLEAN)) != NULL && job_ids)
- {
- send_ipp_status(con, IPP_CONFLICT,
- _("The %s attribute cannot be provided with job-ids."),
-@@ -6342,6 +6401,43 @@
- username[0] = '\0';
-
- ra = create_requested_array(con->request);
-+ for (job_attr = (char *)cupsArrayFirst(ra); job_attr; job_attr = (char *)cupsArrayNext(ra))
-+ if (strcmp(job_attr, "job-id") &&
-+ strcmp(job_attr, "job-k-octets") &&
-+ strcmp(job_attr, "job-media-progress") &&
-+ strcmp(job_attr, "job-more-info") &&
-+ strcmp(job_attr, "job-name") &&
-+ strcmp(job_attr, "job-originating-user-name") &&
-+ strcmp(job_attr, "job-preserved") &&
-+ strcmp(job_attr, "job-printer-up-time") &&
-+ strcmp(job_attr, "job-printer-uri") &&
-+ strcmp(job_attr, "job-state") &&
-+ strcmp(job_attr, "job-state-reasons") &&
-+ strcmp(job_attr, "job-uri") &&
-+ strcmp(job_attr, "time-at-completed") &&
-+ strcmp(job_attr, "time-at-creation") &&
-+ strcmp(job_attr, "number-of-documents"))
-+ {
-+ need_load_job = 1;
-+ break;
-+ }
-+
-+ if (need_load_job && (limit == 0 || limit > 500) && (list == Jobs || delete_list))
-+ {
-+ /*
-+ * Limit expensive Get-Jobs for job history to 500 jobs...
-+ */
-+
-+ ippAddInteger(con->response, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "limit", 500);
-+
-+ if (limit)
-+ ippAddInteger(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_INTEGER, "limit", limit);
-+
-+ limit = 500;
-+
-+ cupsdLogMessage(CUPSD_LOG_INFO,
-+ "Limiting Get-Jobs response to %d jobs.", limit);
-+ }
-
- /*
- * OK, build a list of jobs for this printer...
-@@ -6368,13 +6464,15 @@
- {
- job = cupsdFindJob(job_ids->values[i].integer);
-
-- cupsdLoadJob(job);
--
-- if (!job->attrs)
-+ if (need_load_job && !job->attrs)
- {
-- cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_jobs: No attributes for job %d",
-- job->id);
-- continue;
-+ cupsdLoadJob(job);
-+
-+ if (!job->attrs)
-+ {
-+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_jobs: No attributes for job %d", job->id);
-+ continue;
-+ }
- }
-
- if (i > 0)
-@@ -6424,13 +6522,19 @@
- if (job->id < first_job_id)
- continue;
-
-- cupsdLoadJob(job);
-+ current_index ++;
-+ if (current_index < first_index)
-+ continue;
-
-- if (!job->attrs)
-+ if (need_load_job && !job->attrs)
- {
-- cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_jobs: No attributes for job %d",
-- job->id);
-- continue;
-+ cupsdLoadJob(job);
-+
-+ if (!job->attrs)
-+ {
-+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_jobs: No attributes for job %d", job->id);
-+ continue;
-+ }
- }
-
- if (username[0] && _cups_strcasecmp(username, job->username))
-@@ -8164,8 +8268,9 @@
-
- cupsdUpdateQuota(printer, job->username, 0, kbytes);
-
-- if ((attr = ippFindAttribute(job->attrs, "job-k-octets",
-- IPP_TAG_INTEGER)) != NULL)
-+ job->koctets += kbytes;
-+
-+ if ((attr = ippFindAttribute(job->attrs, "job-k-octets", IPP_TAG_INTEGER)) != NULL)
- attr->values[0].integer += kbytes;
-
- /*
-@@ -9401,8 +9506,9 @@
-
- cupsdUpdateQuota(printer, job->username, 0, kbytes);
-
-- if ((attr = ippFindAttribute(job->attrs, "job-k-octets",
-- IPP_TAG_INTEGER)) != NULL)
-+ job->koctets += kbytes;
-+
-+ if ((attr = ippFindAttribute(job->attrs, "job-k-octets", IPP_TAG_INTEGER)) != NULL)
- attr->values[0].integer += kbytes;
-
- snprintf(filename, sizeof(filename), "%s/d%05d-%03d", RequestRoot, job->id,
---- a/scheduler/job.c
-+++ b/scheduler/job.c
-@@ -1648,9 +1648,10 @@
- job->file_time = 0;
- job->history_time = 0;
-
-- if (job->state_value >= IPP_JOB_CANCELED &&
-- (attr = ippFindAttribute(job->attrs, "time-at-completed",
-- IPP_TAG_INTEGER)) != NULL)
-+ if ((attr = ippFindAttribute(job->attrs, "time-at-creation", IPP_TAG_INTEGER)) != NULL)
-+ job->creation_time = attr->values[0].integer;
-+
-+ if (job->state_value >= IPP_JOB_CANCELED && (attr = ippFindAttribute(job->attrs, "time-at-completed", IPP_TAG_INTEGER)) != NULL)
- {
- job->completed_time = attr->values[0].integer;
-
-@@ -1799,6 +1800,12 @@
- cupsdSetString(&job->username, attr->values[0].string.text);
- }
-
-+ if (!job->name)
-+ {
-+ if ((attr = ippFindAttribute(job->attrs, "job-name", IPP_TAG_NAME)) != NULL)
-+ cupsdSetString(&job->name, attr->values[0].string.text);
-+ }
-+
- /*
- * Set the job hold-until time and state...
- */
-@@ -1823,6 +1830,9 @@
- job->state_value = IPP_JOB_PENDING;
- }
-
-+ if ((attr = ippFindAttribute(job->attrs, "job-k-octets", IPP_TAG_INTEGER)) != NULL)
-+ job->koctets = attr->values[0].integer;
-+
- if (!job->num_files)
- {
- /*
-@@ -2131,14 +2141,18 @@
- {
- cupsFilePrintf(fp, "<Job %d>\n", job->id);
- cupsFilePrintf(fp, "State %d\n", job->state_value);
-+ cupsFilePrintf(fp, "Created %ld\n", (long)job->creation_time);
- if (job->completed_time)
- cupsFilePrintf(fp, "Completed %ld\n", (long)job->completed_time);
- cupsFilePrintf(fp, "Priority %d\n", job->priority);
- if (job->hold_until)
- cupsFilePrintf(fp, "HoldUntil %ld\n", (long)job->hold_until);
- cupsFilePrintf(fp, "Username %s\n", job->username);
-+ if (job->name)
-+ cupsFilePutConf(fp, "Name", job->name);
- cupsFilePrintf(fp, "Destination %s\n", job->dest);
- cupsFilePrintf(fp, "DestType %d\n", job->dtype);
-+ cupsFilePrintf(fp, "KOctets %d\n", job->koctets);
- cupsFilePrintf(fp, "NumFiles %d\n", job->num_files);
- for (i = 0; i < job->num_files; i ++)
- cupsFilePrintf(fp, "File %d %s/%s %d\n", i + 1, job->filetypes[i]->super,
-@@ -4079,7 +4093,7 @@
- cupsArrayAdd(ActiveJobs, job);
- else if (job->state_value > IPP_JOB_STOPPED)
- {
-- if (!job->completed_time)
-+ if (!job->completed_time || !job->creation_time || !job->name || !job->koctets)
- {
- cupsdLoadJob(job);
- unload_job(job);
-@@ -4102,6 +4116,14 @@
- else if (job->state_value > IPP_JOB_COMPLETED)
- job->state_value = IPP_JOB_COMPLETED;
- }
-+ else if (!_cups_strcasecmp(line, "Name"))
-+ {
-+ cupsdSetString(&(job->name), value);
-+ }
-+ else if (!_cups_strcasecmp(line, "Created"))
-+ {
-+ job->creation_time = strtol(value, NULL, 10);
-+ }
- else if (!_cups_strcasecmp(line, "Completed"))
- {
- job->completed_time = strtol(value, NULL, 10);
-@@ -4126,6 +4148,10 @@
- {
- job->dtype = (cups_ptype_t)atoi(value);
- }
-+ else if (!_cups_strcasecmp(line, "KOctets"))
-+ {
-+ job->koctets = atoi(value);
-+ }
- else if (!_cups_strcasecmp(line, "NumFiles"))
- {
- job->num_files = atoi(value);
---- a/scheduler/job.h
-+++ b/scheduler/job.h
-@@ -39,6 +39,8 @@
- * waiting on files */
- char *username; /* Printing user */
- char *dest; /* Destination printer or class */
-+ char *name; /* Job name/title */
-+ int koctets; /* job-k-octets */
- cups_ptype_t dtype; /* Destination type */
- cupsd_printer_t *printer; /* Printer this job is assigned to */
- int num_files; /* Number of files in job */
-@@ -47,6 +49,7 @@
- ipp_attribute_t *sheets; /* job-media-sheets-completed */
- time_t access_time, /* Last access time */
- cancel_time, /* When to cancel/send SIGTERM */
-+ creation_time, /* When job was created */
- completed_time, /* When job was completed (0 if not) */
- file_time, /* Job file retain time */
- history_time, /* Job history retain time */
diff --git a/debian/patches/str4461-restore-access-to-logfiles.patch b/debian/patches/str4461-restore-access-to-logfiles.patch
index 83a8aa0db..b146a4367 100644
--- a/debian/patches/str4461-restore-access-to-logfiles.patch
+++ b/debian/patches/str4461-restore-access-to-logfiles.patch
@@ -103,7 +103,7 @@ Last-Update: 2014-10-22
Group, 1, 1) < 0 ||
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
-@@ -2735,7 +2735,6 @@
+@@ -2734,7 +2734,6 @@
cupsdLogMessage(CUPSD_LOG_DEBUG,
"Copied PPD file successfully");
@@ -111,7 +111,7 @@ Last-Update: 2014-10-22
}
}
-@@ -4643,7 +4642,7 @@
+@@ -4641,7 +4640,7 @@
* Open the destination file for a copy...
*/
@@ -120,7 +120,7 @@ Last-Update: 2014-10-22
{
cupsFreeOptions(num_defaults, defaults);
cupsFileClose(src);
-@@ -4698,7 +4697,7 @@
+@@ -4696,7 +4695,7 @@
unlink(tempfile);
diff --git a/debian/patches/str4484-fix-random-crash-in-scheduler.patch b/debian/patches/str4484-fix-random-crash-in-scheduler.patch
new file mode 100644
index 000000000..1036bf140
--- /dev/null
+++ b/debian/patches/str4484-fix-random-crash-in-scheduler.patch
@@ -0,0 +1,219 @@
+Description: Backport upstream fix to fix a random crash in the scheduler when not using systemd
+Bug-Debian: https://bugs.debian.org/760476
+Bug: https://cups.org/str.php?L4484
+Last-Update: 2014-11-23
+--- a/scheduler/main.c
++++ b/scheduler/main.c
+@@ -100,6 +100,8 @@
+ int i; /* Looping var */
+ char *opt; /* Option character */
+ int fg; /* Run in the foreground */
++ int close_all = 1, /* Close all file descriptors? */
++ disconnect = 1; /* Disconnect from controlling terminal? */
+ int fds; /* Number of ready descriptors */
+ cupsd_client_t *con; /* Current client */
+ cupsd_job_t *job; /* Current job */
+@@ -152,6 +154,8 @@
+ {
+ Launchd = 1;
+ fg = 1;
++ close_all = 0;
++ disconnect = 0;
+ }
+ #endif /* HAVE_LAUNCHD */
+
+@@ -163,6 +167,7 @@
+ case 'C' : /* Run as child with config file */
+ run_as_child = 1;
+ fg = -1;
++ close_all = 0;
+
+ case 'c' : /* Configuration file */
+ i ++;
+@@ -218,10 +223,13 @@
+
+ case 'f' : /* Run in foreground... */
+ fg = 1;
++ disconnect = 0;
++ close_all = 0;
+ break;
+
+ case 'F' : /* Run in foreground, but disconnect from terminal... */
+ fg = -1;
++ close_all = 0;
+ break;
+
+ case 'h' : /* Show usage/help */
+@@ -232,10 +240,14 @@
+ #ifdef HAVE_LAUNCHD
+ Launchd = 1;
+ fg = 1;
++ close_all = 0;
++ disconnect = 0;
+ #else
+ _cupsLangPuts(stderr, _("cupsd: launchd(8) support not compiled "
+ "in, running in normal mode."));
+ fg = 0;
++ disconnect = 1;
++ close_all = 1;
+ #endif /* HAVE_LAUNCHD */
+ break;
+
+@@ -244,6 +256,8 @@
+ "use only!\n", stderr);
+ stop_scheduler = 1;
+ fg = 1;
++ disconnect = 0;
++ close_all = 0;
+ break;
+
+ case 'P' : /* Disable security profiles */
+@@ -286,6 +300,8 @@
+ case 't' : /* Test the cupsd.conf file... */
+ TestConfigFile = 1;
+ fg = 1;
++ disconnect = 0;
++ close_all = 0;
+ break;
+
+ default : /* Unknown option */
+@@ -333,8 +349,57 @@
+ free(filename);
+ }
+
++ if (disconnect)
++ {
++ /*
++ * Make sure we aren't tying up any filesystems...
++ */
++
++ chdir("/");
++
++ /*
++ * Disconnect from the controlling terminal...
++ */
++
++ setsid();
++ }
++
++ if (close_all)
++ {
++ /*
++ * Close all open files...
++ */
++
++ getrlimit(RLIMIT_NOFILE, &limit);
++
++ for (i = 0; i < (int)limit.rlim_cur && i < 1024; i ++)
++ close(i);
++
++ /*
++ * Redirect stdin/out/err to /dev/null...
++ */
++
++ if ((i = open("/dev/null", O_RDONLY)) != 0)
++ {
++ dup2(i, 0);
++ close(i);
++ }
++
++ if ((i = open("/dev/null", O_WRONLY)) != 1)
++ {
++ dup2(i, 1);
++ close(i);
++ }
++
++ if ((i = open("/dev/null", O_WRONLY)) != 2)
++ {
++ dup2(i, 2);
++ close(i);
++ }
++ }
++
+ /*
+- * If the user hasn't specified "-f", run in the background...
++ * Run in the background as needed...
+ */
+
+ if (!fg)
+@@ -409,74 +474,17 @@
+ #endif /* __OpenBSD__ && OpenBSD < 201211 */
+
+ /*
+- * Since CoreFoundation and DBUS both create fork-unsafe data on execution of
+- * a program, and since this kind of really unfriendly behavior seems to be
+- * more common these days in system libraries, we need to re-execute the
+- * background cupsd with the "-C" option to avoid problems. Unfortunately,
+- * we also have to assume that argv[0] contains the name of the cupsd
+- * executable - there is no portable way to get the real pathname...
++ * Since many system libraries create fork-unsafe data on execution of a
++ * program, we need to re-execute the background cupsd with the "-C" and "-s"
++ * options to avoid problems. Unfortunately, we also have to assume that
++ * argv[0] contains the name of the cupsd executable - there is no portable
++ * way to get the real pathname...
+ */
+
+- execlp(argv[0], argv[0], "-C", ConfigurationFile, (char *)0);
++ execlp(argv[0], argv[0], "-C", ConfigurationFile, "-s", CupsFilesFile, (char *)0);
+ exit(errno);
+ }
+
+- if (fg < 1)
+- {
+- /*
+- * Make sure we aren't tying up any filesystems...
+- */
+-
+- chdir("/");
+-
+-#ifndef DEBUG
+- /*
+- * Disable core dumps...
+- */
+-
+- getrlimit(RLIMIT_CORE, &limit);
+- limit.rlim_cur = 0;
+- setrlimit(RLIMIT_CORE, &limit);
+-
+- /*
+- * Disconnect from the controlling terminal...
+- */
+-
+- setsid();
+-
+- /*
+- * Close all open files...
+- */
+-
+- getrlimit(RLIMIT_NOFILE, &limit);
+-
+- for (i = 0; i < limit.rlim_cur && i < 1024; i ++)
+- close(i);
+-
+- /*
+- * Redirect stdin/out/err to /dev/null...
+- */
+-
+- if ((i = open("/dev/null", O_RDONLY)) != 0)
+- {
+- dup2(i, 0);
+- close(i);
+- }
+-
+- if ((i = open("/dev/null", O_WRONLY)) != 1)
+- {
+- dup2(i, 1);
+- close(i);
+- }
+-
+- if ((i = open("/dev/null", O_WRONLY)) != 2)
+- {
+- dup2(i, 2);
+- close(i);
+- }
+-#endif /* DEBUG */
+- }
+-
+ /*
+ * Set the timezone info...
+ */
diff --git a/debian/patches/systemd-optional-socket-activation.patch b/debian/patches/systemd-optional-socket-activation.patch
index e7f0c8087..e9ce4b668 100644
--- a/debian/patches/systemd-optional-socket-activation.patch
+++ b/debian/patches/systemd-optional-socket-activation.patch
@@ -250,7 +250,7 @@ Last-Update: 2014-10-23
static void parent_handler(int sig);
static void process_children(void);
static void sigchld_handler(int sig);
-@@ -578,6 +585,14 @@
+@@ -586,6 +593,14 @@
}
#endif /* HAVE_LAUNCHD */
@@ -265,7 +265,7 @@ Last-Update: 2014-10-23
/*
* Startup the server...
*/
-@@ -766,6 +781,16 @@
+@@ -774,6 +789,16 @@
}
#endif /* HAVE_LAUNCHD */
@@ -282,7 +282,7 @@ Last-Update: 2014-10-23
/*
* Startup the server...
*/
-@@ -1549,6 +1574,104 @@
+@@ -1557,6 +1582,104 @@
}
#endif /* HAVE_LAUNCHD */