[cups] Till's patch to fix USB-Parallel adapter cable problem (bug #624564).

Jiří Popelka jpopelka at fedoraproject.org
Tue Feb 1 15:38:50 UTC 2011


commit 52d3a41e09eff79ff1bcbf3925ef36fc61b04fe0
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Tue Feb 1 16:31:48 2011 +0100

    Till's patch to fix USB-Parallel adapter cable problem (bug #624564).

 cups-usb-parallel.patch |   67 +++++++++++++++++++++++++++++++++++++++++++++++
 cups.spec               |    8 +++++-
 2 files changed, 74 insertions(+), 1 deletions(-)
---
diff --git a/cups-usb-parallel.patch b/cups-usb-parallel.patch
new file mode 100644
index 0000000..c683d89
--- /dev/null
+++ b/cups-usb-parallel.patch
@@ -0,0 +1,67 @@
+diff -up cups-1.4.6/backend/ieee1284.c.usb-parallel cups-1.4.6/backend/ieee1284.c
+--- cups-1.4.6/backend/ieee1284.c.usb-parallel	2010-04-10 00:42:09.000000000 +0200
++++ cups-1.4.6/backend/ieee1284.c	2011-02-01 16:13:44.000000000 +0100
+@@ -55,7 +55,7 @@ backendGetDeviceID(
+ #  if defined(__sun) && defined(ECPPIOC_GETDEVID)
+   struct ecpp_device_id did;		/* Device ID buffer */
+ #  endif /* __sun && ECPPIOC_GETDEVID */
+-
++  char  *c;
+ 
+   DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
+                 "make_model=%p, make_model_size=%d, scheme=\"%s\", "
+@@ -176,7 +176,7 @@ backendGetDeviceID(
+       * and then limit the length to the size of our buffer...
+       */
+ 
+-      if (length > device_id_size)
++      if ((length > device_id_size) || (length < 14))
+ 	length = (((unsigned)device_id[1] & 255) << 8) +
+ 		 ((unsigned)device_id[0] & 255);
+ 
+@@ -214,11 +214,16 @@ backendGetDeviceID(
+ 	device_id[length] = '\0';
+       }
+     }
+-#    ifdef DEBUG
+     else
++    {
++#    ifdef DEBUG
++
+       DEBUG_printf(("backendGetDeviceID: ioctl failed - %s\n",
+                     strerror(errno)));
+ #    endif /* DEBUG */
++      /* Clean up after failed attempt to get device ID */
++      *device_id = '\0';
++    }
+ #  endif /* __linux */
+ 
+ #   if defined(__sun) && defined(ECPPIOC_GETDEVID)
+@@ -246,14 +251,24 @@ backendGetDeviceID(
+ #  endif /* __sun && ECPPIOC_GETDEVID */
+   }
+ 
++ /*
++  * Check whether device ID is valid. Turn line breaks and tabs to spaces
++  * and abort device IDs with non-printable characters
++  */
++  for (c = device_id; *c; c++)
++    if (isspace(*c))
++      *c = ' ';
++    else if (!isprint(*c))
++    {
++      *device_id = '\0';
++      break;
++    }
++
+   DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
+ 
+   if (scheme && uri)
+     *uri = '\0';
+ 
+-  if (!*device_id)
+-    return (-1);
+-
+  /*
+   * Get the make and model...
+   */
diff --git a/cups.spec b/cups.spec
index 547fac3..6a08e43 100644
--- a/cups.spec
+++ b/cups.spec
@@ -8,7 +8,7 @@
 Summary: Common Unix Printing System
 Name: cups
 Version: 1.4.6
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: GPLv2
 Group: System Environment/Daemons
 Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
@@ -69,6 +69,7 @@ Patch39: cups-str3754.patch
 Patch40: cups-avahi.patch
 Patch41: cups-usb-buffer-size.patch
 Patch42: cups-icc.patch
+Patch43: cups-usb-parallel.patch
 
 Patch100: cups-lspp.patch
 
@@ -288,6 +289,8 @@ module.
 %patch41 -p1 -b .usb-buffer-size
 # ICC colord support.
 %patch42 -p1 -b .icc
+# Till's patch to fix USB-Parallel adapter cable problem (bug #624564).
+%patch43 -p1 -b .usb-parallel
 
 %if %lspp
 # LSPP support.
@@ -603,6 +606,9 @@ rm -rf $RPM_BUILD_ROOT
 %{php_extdir}/phpcups.so
 
 %changelog
+* Tue Feb 01 2011 Jiri Popelka <jpopelka at redhat.com> 1:1.4.6-8
+- Use Till's patch to fix USB-Parallel adapter cable problem (bug #624564).
+
 * Tue Jan 25 2011 Tim Waugh <twaugh at redhat.com> 1:1.4.6-7
 - Some fixes for the AvahiClient callback (bug #672143).
 


More information about the scm-commits mailing list