[Pkg-cups-devel] Please accept cups 1.3.8-1lenny3 into lenny

Martin Pitt mpitt at debian.org
Thu Nov 20 09:27:29 UTC 2008


Hello release team,

I cherrypicked some important (1 RC) bug fixes from the experimental
trunk and uploaded to unstable. Please allow this for lenny migration,
since it affects quite a lot of people.

| cups (1.3.8-1lenny3) unstable; urgency=medium
| 
|   * Urgency medium because of RC bug fix.
|   * debian/cups-bsd.postinst: Assume default printcap path (in /var/run/cups/)
|     if not specified in cupsd.conf. This brings back the lost /etc/printcap
|     for legacy applications. (Closes: #482186, LP: #282667)

Just putting back the symlink, has been like this in earlier releases
and very low regression potential.

|   * hpgl-regression.dpatch: Replaced with version which got committed
|     upstream.

While my initially proposed and commited patch worked as well,
upstream's patch is more in line with the original security fix
(changing the HPGL pen enumeration to start from 0). I verified that
it works with a range of HPGL files.

|   * Add runloop-backchannel-eof-spin.dpatch: Fix backend runloop spin on
|     backchannel EOF (select() returns "ready for read" on EOF). This
|     completely broke printing with e. g. HPJetDirect. Thanks to
|     Samuel Thibault for tracking down the problem! (Closes: #489045)

This is a nasty thing, and is probably responsible for all sorts of
weird problems. In cases where the device control stream got an EOF,
it caused cups to spin CPU and slow down printing to a crawl, or stop
it altogether.

|   * debian/rules: Install the serial backend with 0744 permissions to make it
|     run as root, since /dev/ttyS* are root:dialout and thus not accessible as
|     user "lp". Thanks to Chanoch (Ken) Bloom. (One part of #506181)

Low regression potential. serial backend currently doesn't work at all
due to this, and Chanoch confirmed that it worked after fixing the
permissions.

| 
|  -- Martin Pitt <mpitt at debian.org>  Thu, 20 Nov 2008 09:05:35 +0100

debdiff attached. Please let me know if you have any further questions
or doubts.

Thank you!

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
diff -u cups-1.3.8/debian/changelog cups-1.3.8/debian/changelog
--- cups-1.3.8/debian/changelog
+++ cups-1.3.8/debian/changelog
@@ -1,3 +1,21 @@
+cups (1.3.8-1lenny3) unstable; urgency=medium
+
+  * Urgency medium because of RC bug fix.
+  * debian/cups-bsd.postinst: Assume default printcap path (in /var/run/cups/)
+    if not specified in cupsd.conf. This brings back the lost /etc/printcap
+    for legacy applications. (Closes: #482186, LP: #282667)
+  * hpgl-regression.dpatch: Replaced with version which got committed
+    upstream.
+  * Add runloop-backchannel-eof-spin.dpatch: Fix backend runloop spin on
+    backchannel EOF (select() returns "ready for read" on EOF). This
+    completely broke printing with e. g. HPJetDirect. Thanks to
+    Samuel Thibault for tracking down the problem! (Closes: #489045)
+  * debian/rules: Install the serial backend with 0744 permissions to make it
+    run as root, since /dev/ttyS* are root:dialout and thus not accessible as
+    user "lp". Thanks to Chanoch (Ken) Bloom. (One part of #506181)
+
+ -- Martin Pitt <mpitt at debian.org>  Thu, 20 Nov 2008 09:05:35 +0100
+
 cups (1.3.8-1lenny2) unstable; urgency=high
 
   * Urgency high due to security fixes.
diff -u cups-1.3.8/debian/rules cups-1.3.8/debian/rules
--- cups-1.3.8/debian/rules
+++ cups-1.3.8/debian/rules
@@ -73,6 +73,10 @@
 	   install -D -m 644 debian/local/apparmor-profile debian/$(cdbs_curpkg)/etc/apparmor.d/usr.sbin.cupsd; \
 	fi
 
+	# Make the serial backend run as root, since /dev/ttyS* are
+	# root:dialout and thus not accessible as user lp
+	chmod go-x debian/$(cdbs_curpkg)/usr/lib/cups/backend-available/serial
+
 binary-post-install/libcupsimage2-dev::
 	rm -r debian/libcupsimage2-dev/usr/share/doc/libcupsimage2-dev
 	ln -s libcupsimage2 debian/libcupsimage2-dev/usr/share/doc/libcupsimage2-dev
diff -u cups-1.3.8/debian/cups-bsd.postinst cups-1.3.8/debian/cups-bsd.postinst
--- cups-1.3.8/debian/cups-bsd.postinst
+++ cups-1.3.8/debian/cups-bsd.postinst
@@ -51,11 +51,11 @@
 	    fi
 
 	    printcap_file=`egrep '^Printcap ' /etc/cups/cupsd.conf | awk '{print $2}'`
-	    if [ "$printcap_file" != "" ]; then
-		touch $printcap_file 2>/dev/null || true
-		if [ ! -e /etc/printcap -a -e $printcap_file ]; then
-		    ln -s $printcap_file /etc/printcap
-		fi
+	    if [ -z "$printcap_file" ]; then
+		printcap_file=/var/run/cups/printcap
+	    fi
+	    if [ ! -e /etc/printcap -a -e $printcap_file ]; then
+	        ln -s $printcap_file /etc/printcap
 	    fi
 	fi
     ;;
diff -u cups-1.3.8/debian/patches/00list cups-1.3.8/debian/patches/00list
--- cups-1.3.8/debian/patches/00list
+++ cups-1.3.8/debian/patches/00list
@@ -8,6 +8,8 @@
 
 # patches accepted and committed upstream
 freebsd.dpatch
+hpgl-regression.dpatch
+runloop-backchannel-eof-spin.dpatch
 
 # patches sent upstream
 pidfile.dpatch
@@ -15,7 +17,6 @@
 # no answer yet, po4a might not be appropriate
 manpage-translations.dpatch
 admin-fr-translation.dpatch
-hpgl-regression.dpatch
 
 # Debian patches
 removecvstag.dpatch
diff -u cups-1.3.8/debian/patches/hpgl-regression.dpatch cups-1.3.8/debian/patches/hpgl-regression.dpatch
--- cups-1.3.8/debian/patches/hpgl-regression.dpatch
+++ cups-1.3.8/debian/patches/hpgl-regression.dpatch
@@ -1,14 +1,21 @@
 #! /bin/sh /usr/share/dpatch/dpatch-run
 ## hpgl-regression.dpatch by Martin Pitt <mpitt at debian.org>
 ##
-## DP: Revert the SP_select_pen() enumeration change introduced in STR #2911,
-## DP: because it changes the color mapping (e. g. "SP1" would now select a
-## DP: white pen instead of a black one, and "SP0" would not be valid at all
-## DP: any more). Also fix a remaining off-by-one loop. (STR #2966)
+## DP: Fix HPGL pen selection regression introduced in STR #2911.
+## DP: Also fix a remaining off-by-one loop. (STR #2966)
 @DPATCH@
 diff -urNad trunk~/filter/hpgl-attr.c trunk/filter/hpgl-attr.c
 --- trunk~/filter/hpgl-attr.c	2008-10-09 22:12:03.000000000 +0200
-+++ trunk/filter/hpgl-attr.c	2008-10-10 10:55:46.000000000 +0200
++++ trunk/filter/hpgl-attr.c	2008-11-13 11:26:46.000000000 +0100
+@@ -3,7 +3,7 @@
+  *
+  *   HP-GL/2 attribute processing for the Common UNIX Printing System (CUPS).
+  *
+- *   Copyright 2007 by Apple Inc.
++ *   Copyright 2007-2008 by Apple Inc.
+  *   Copyright 1993-2007 by Easy Software Products.
+  *
+  *   These coded instructions, statements, and computer programs are the
 @@ -214,7 +214,7 @@
              "DEBUG: HP-GL/2 \'NP\' command with invalid number of "
  	    "parameters (%d)!\n", num_params);
@@ -21,9 +28,53 @@
-@@ -433,7 +433,7 @@
-     fprintf(stderr, "DEBUG: HP-GL/2 \'SP\' command with invalid pen (%d)!\n",
- 	    (int)params[0].value.number);
-   else
--    PenNumber = (int)params[0].value.number - 1;
-+    PenNumber = (int)params[0].value.number;
+@@ -232,14 +232,14 @@
+   int		i;			/* Looping var */
+   static float	standard_colors[8][3] =	/* Standard colors for first 8 pens */
+ 		{
+-		  { 1.0, 1.0, 1.0 },	/* White */
+ 		  { 0.0, 0.0, 0.0 },	/* Black */
+ 		  { 1.0, 0.0, 0.0 },	/* Red */
+ 		  { 0.0, 1.0, 0.0 },	/* Green */
+ 		  { 1.0, 1.0, 0.0 },	/* Yellow */
+ 		  { 0.0, 0.0, 1.0 },	/* Blue */
+ 		  { 1.0, 0.0, 1.0 },	/* Magenta */
+-		  { 0.0, 1.0, 1.0 }	/* Cyan */
++		  { 0.0, 1.0, 1.0 },	/* Cyan */
++		  { 1.0, 1.0, 1.0 }	/* White */
+ 		};
  
-   if (PageDirty)
-     printf("%.3f %.3f %.3f %.2f SP\n", Pens[PenNumber].rgb[0],
+ 
+diff -urNad trunk~/filter/hpgl-vector.c trunk/filter/hpgl-vector.c
+--- trunk~/filter/hpgl-vector.c	2008-07-12 00:48:49.000000000 +0200
++++ trunk/filter/hpgl-vector.c	2008-11-13 11:26:03.000000000 +0100
+@@ -3,7 +3,7 @@
+  *
+  *   HP-GL/2 vector routines for the Common UNIX Printing System (CUPS).
+  *
+- *   Copyright 2007 by Apple Inc.
++ *   Copyright 2007-2008 by Apple Inc.
+  *   Copyright 1993-2007 by Easy Software Products.
+  *
+  *   These coded instructions, statements, and computer programs are the
+@@ -393,13 +393,20 @@
+           break;
+       case ':' :	/* Select pen */
+           s ++;
+-          PenNumber = (int)decode_number(&s, base_bits, 1.0);
++          temp = (int)decode_number(&s, base_bits, 1.0) - 1;
++         if (temp < 0 || temp >= PenCount)
++         {
++           fprintf(stderr, "DEBUG: Bad pen number %d in PE\n", temp + 1);
++           return;
++         }
++
++          PenNumber = temp;
+ 
+ #ifdef DEBUG
+-          fprintf(stderr, "DEBUG:     set pen #%d\n", PenNumber);
++          fprintf(stderr, "DEBUG:     set pen #%d\n", PenNumber + 1);
+ #endif /* DEBUG */
+ 
+-          Outputf("%% PE: set pen #%d\n", PenNumber);
++          Outputf("%% PE: set pen #%d\n", PenNumber + 1);
+ 
+ 	  if (PageDirty)
+ 	    printf("%.3f %.3f %.3f %.2f SP\n", Pens[PenNumber].rgb[0],
only in patch2:
unchanged:
--- cups-1.3.8.orig/debian/patches/runloop-backchannel-eof-spin.dpatch
+++ cups-1.3.8/debian/patches/runloop-backchannel-eof-spin.dpatch
@@ -0,0 +1,23 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## runloop-backchannel-eof-spin.dpatch by Martin Pitt <mpitt at debian.org>
+##
+## DP: Fix backend runloop spin on backchannel EOF (select() returns "ready for
+## DP: read" on EOF). This completely broke printing with e. g. HPJetDirect.
+## DP: (http://bugs.debian.org/489045, STR #3001)
+ at DPATCH@
+--- trunk/backend/runloop.c   (revision 8127)
++++ trunk/backend/runloop.c   (working copy)
+@@ -283,6 +283,12 @@
+                CUPS_LLCAST bc_bytes);
+         cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
+       }
++      else if (bc_bytes < 0 && errno != EAGAIN && errno != EINTR)
++      {
++        fprintf(stderr, "DEBUG: Error reading back-channel data: %s\n",
++               strerror(errno));
++       use_bc = 0;
++      }
+     }
+ 
+    /*
+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-cups-devel/attachments/20081120/d75859c0/attachment-0001.pgp 


More information about the Pkg-cups-devel mailing list