summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2019-09-04 08:25:25 +0200
committerDidier Raboud <odyx@debian.org>2019-09-04 08:25:25 +0200
commit293b7d45456b2fd47e17673ee641f34e0687013f (patch)
tree5f024b082523ae7c47e6f4d8f46f83eb587b20f4
parent5115e5eab5ccfa97ff6f74a3a79ed3de577cacd9 (diff)
Commit patch queue (exported by git-debrebase)debian/1.25.4-2archive/debian/1.25.4-2
[git-debrebase make-patches: export and commit patches]
-rw-r--r--debian/patches/0001-cups-browsed-Do-not-cause-fatal-error-on-left-over-q.patch83
-rw-r--r--debian/patches/series1
2 files changed, 84 insertions, 0 deletions
diff --git a/debian/patches/0001-cups-browsed-Do-not-cause-fatal-error-on-left-over-q.patch b/debian/patches/0001-cups-browsed-Do-not-cause-fatal-error-on-left-over-q.patch
new file mode 100644
index 000000000..dc11f489f
--- /dev/null
+++ b/debian/patches/0001-cups-browsed-Do-not-cause-fatal-error-on-left-over-q.patch
@@ -0,0 +1,83 @@
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Tue, 3 Sep 2019 15:14:58 +0200
+Subject: cups-browsed: Do not cause fatal error on left over queues of a
+ previous session.
+
+ cups-browsed: If a locally generated queue (usually with
+ "implicitclass://..." URI) left over from a previous
+ (crashed) session is picked up on startup, do not set the
+ URI as the remote printer's URI and do not cause a fatal
+ error on a failed get-printer-attributes IPP request (Issue
+ #148).
+
+Closes-Debian: #939316
+---
+ utils/cups-browsed.c | 31 ++++++++++++++++++++-----------
+ 1 file changed, 20 insertions(+), 11 deletions(-)
+
+diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c
+index c828bd1..ddddbe0 100644
+--- a/utils/cups-browsed.c
++++ b/utils/cups-browsed.c
+@@ -6908,12 +6908,12 @@ create_remote_printer_entry (const char *queue_name,
+ remote CUPS server gets used. So we will not generate a PPD file
+ or interface script at this point. */
+ p->netprinter = 0;
+- p->prattrs = get_printer_attributes(p->uri);
+ p->nickname = NULL;
+- if (p->prattrs == NULL) {
+- debug_printf("get-printer-attributes IPP call failed on printer %s (%s).\n",
+- p->queue_name, p->uri);
+- goto fail;
++ if (p->uri[0] != '\0') {
++ p->prattrs = get_printer_attributes(p->uri);
++ if (p->prattrs == NULL)
++ debug_printf("get-printer-attributes IPP call failed on printer %s (%s).\n",
++ p->queue_name, p->uri);
+ }
+ } else {
+ #ifndef HAVE_CUPS_1_6
+@@ -9133,9 +9133,19 @@ examine_discovered_printer_record(const char *host,
+ discovered through the loopback interface (preferred interface) */
+ ipp_discovery_t *ippdis = cupsArrayFirst(p->ipp_discoveries);
+
++ /* Force upgrade if the found entry is marked unconfirmed or
++ disappeared */
++ if (p->status == STATUS_UNCONFIRMED ||
++ p->status == STATUS_DISAPPEARED) {
++ upgrade = 1;
++ debug_printf("Replacing printer entry %s (Host: %s, Port: %d) as it was marked %s. New URI: %s\n",
++ p->queue_name, remote_host, port,
++ (p->status == STATUS_UNCONFIRMED ? "unconfirmed" :
++ "disappeared"),
++ uri);
+ /* Check if there is a downgrade */
+ /* IPPS -> IPP */
+- if ((ptr = strcasestr(type, "_ipp")) != NULL &&
++ } else if ((ptr = strcasestr(type, "_ipp")) != NULL &&
+ *(ptr + 4) != 's' &&
+ !strncasecmp(p->uri, "ipps:", 5)) {
+ downgrade = 1;
+@@ -11468,7 +11478,7 @@ find_previous_queue (gpointer key,
+ debug_printf("find_previous_queue() in THREAD %ld\n", pthread_self());
+ if (printer->cups_browsed_controlled) {
+ /* Queue found, add to our list */
+- p = create_remote_printer_entry (name, "", "", printer->device_uri, "", "",
++ p = create_remote_printer_entry (name, "", "", "", "", "",
+ 0, "", "", "", "", 0, NULL, 0, 0, NULL,
+ -1);
+ if (p) {
+@@ -11484,10 +11494,9 @@ find_previous_queue (gpointer key,
+ p->slave_of = NULL;
+ debug_printf("Found CUPS queue %s (URI: %s) from previous session.\n",
+ p->queue_name, p->uri);
+- } else {
+- debug_printf("ERROR: Unable to allocate memory.\n");
+- exit(1);
+- }
++ } else
++ debug_printf("ERROR: Unable to create print queue entry for prrinter of previous session: %s (%s).\n",
++ name, printer->device_uri);
+ }
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 000000000..6366606e2
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-cups-browsed-Do-not-cause-fatal-error-on-left-over-q.patch