[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#848404: cups-browsed: CreateRemoteCUPSPrinterQueues has no effect



The problem with cups-browsed erroring out when CreateRemoteCUPSPrinterQueues=No is set and queues from the previous cups-browsed session did not get removed I have solved now.

The fix is intended to be BZR rev. 7583, but the servers of the Linux Foundation went completely down, so I attach it also as a patch.

   Till

=== modified file 'NEWS'
--- NEWS	2016-12-17 12:58:18 +0000
+++ NEWS	2016-12-17 17:22:01 +0000
@@ -3,6 +3,10 @@
 
 CHANGES IN V1.13.1
 
+	- cups-browsed: Avoid erroring out when restarting after a
+	  crash (with generated queues not deleted due to the crash)
+	  and the configuration option
+	  CreateRemoteCUPSPrinterQueues=No being set.
 	- cups-browsed: If CUPS is stopped while cups-browsed is
           running and there are queue for IPP network printers (not
           remote CUPS queues) on restart of CUPS the still existing

=== modified file 'utils/cups-browsed.c'
--- utils/cups-browsed.c	2016-12-17 15:41:19 +0000
+++ utils/cups-browsed.c	2016-12-17 17:22:01 +0000
@@ -2975,15 +2975,17 @@
   /* Flag to mark whether this printer was discovered through a legacy
      CUPS broadcast (1) or through DNS-SD/Bonjour (0) */
   p->is_legacy = 0;
-  
-  if (is_cups_queue) {
-    if (CreateRemoteCUPSPrinterQueues == 0) {
+
+  /* Remote CUPS printer or local queue remaining from previous cups-browsed
+     session */
+  if (is_cups_queue == 1 || is_cups_queue == -1) {
+    if (is_cups_queue == 1 && CreateRemoteCUPSPrinterQueues == 0) {
       debug_printf("Printer %s (%s) is a remote CUPS printer and cups-browsed is not configured to set up such printers automatically, ignoring this printer.\n",
 		   p->name, p->uri);
       goto fail;
     }
-    /* Our local queue must be raw, so that the PPD file and driver
-       on the remote CUPS server get used */
+    /* For a remote CUPS printer Our local queue must be raw, so that the
+       PPD file and driver on the remote CUPS server get used */
     p->netprinter = 0;
     p->ppd = NULL;
     p->model = NULL;
@@ -6604,7 +6606,7 @@
     /* Queue found, add to our list */
     p = create_local_queue (name,
 			    printer->device_uri,
-			    "", "", 0, "", "", "", NULL, 0, 0, NULL, NULL, 1);
+			    "", "", 0, "", "", "", NULL, 0, 0, NULL, NULL, -1);
     if (p) {
       /* Mark as unconfirmed, if no Avahi report of this queue appears
 	 in a certain time frame, we will remove the queue */


Reply to: