summaryrefslogtreecommitdiff
path: root/extra/cups
diff options
context:
space:
mode:
Diffstat (limited to 'extra/cups')
-rw-r--r--extra/cups/PKGBUILD71
-rw-r--r--extra/cups/cups-1.6.0-fix-install-perms.patch25
-rw-r--r--extra/cups/cups-1.6.2-statedir.patch12
-rw-r--r--extra/cups/cups-avahi-address.patch75
-rw-r--r--extra/cups/cups-dbus-utf8.patch106
-rw-r--r--extra/cups/cups-enum-all.patch17
-rw-r--r--extra/cups/cups-res_init.patch26
-rw-r--r--extra/cups/cupsd-no-crash-on-avahi-threaded-poll-shutdown.patch19
-rw-r--r--extra/cups/get-ppd-file-for-statically-configured-ipp-shared-queues.patch31
-rw-r--r--extra/cups/ppd-poll-with-client-conf.patch23
-rw-r--r--extra/cups/usb-backend-do-not-crash-if-usb-disabled-in-bios.patch54
-rw-r--r--extra/cups/usb-backend-more-quirk-rules.patch66
12 files changed, 518 insertions, 7 deletions
diff --git a/extra/cups/PKGBUILD b/extra/cups/PKGBUILD
index 3706afac0..6b382d3f6 100644
--- a/extra/cups/PKGBUILD
+++ b/extra/cups/PKGBUILD
@@ -1,29 +1,56 @@
-# $Id: PKGBUILD 185777 2013-05-18 15:46:13Z andyrtr $
+# $Id: PKGBUILD 188723 2013-06-18 15:31:30Z andyrtr $
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
pkgbase="cups"
pkgname=('libcups' 'cups')
pkgver=1.6.2
-pkgrel=2
+pkgrel=3
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.cups.org/"
makedepends=('libtiff>=4.0.0' 'libpng>=1.5.7' 'acl' 'pam' 'xdg-utils' 'krb5' 'gnutls>=2.8.3' 'cups-filters' 'bc'
'colord' 'xinetd' 'gzip' 'autoconf' 'libusb' 'dbus-core' 'avahi' 'hicolor-icon-theme' 'systemd')
-source=(ftp://ftp.easysw.com/pub/cups/${pkgver}/cups-${pkgver}-source.tar.bz2
+source=(#http://mirror.easysw.com/pub/cups/${pkgver}/cups-${pkgver}-source.tar.bz2
+ http://www.cups.org/software/${pkgver}/cups-${pkgver}-source.tar.gz
+ cups.logrotate cups.pam
+ # improve build and linking
cups-no-export-ssllibs.patch
cups-no-gcrypt.patch
cups-no-gzip-man.patch
+ # FC
cups-systemd-socket.patch
- cups.logrotate cups.pam)
+ cups-dbus-utf8.patch
+ cups-res_init.patch
+ cups-avahi-address.patch
+ cups-enum-all.patch
+ # Gentoo
+ cups-1.6.0-fix-install-perms.patch
+ cups-1.6.2-statedir.patch
+ # Debian
+ usb-backend-more-quirk-rules.patch
+ cupsd-no-crash-on-avahi-threaded-poll-shutdown.patch
+ get-ppd-file-for-statically-configured-ipp-shared-queues.patch
+ ppd-poll-with-client-conf.patch
+ usb-backend-do-not-crash-if-usb-disabled-in-bios.patch)
#options=('!emptydirs')
-md5sums=('13c8b2b2336d42001abe4899766b62dc'
+md5sums=('8b8e40560b67e28607b1f04dafd9a94d'
+ 'f861b18f4446c43918c8643dcbbd7f6d'
+ '96f82c38f3f540b53f3e5144900acf17'
'3ba9e3410df1dc3015463d615ef91b3b'
'cc4101beccb5ed6deb1c92707a575925'
'90c30380d4c8cd48a908cfdadae1ea24'
'b4868b83f7f2d6ec24a1be76509379f0'
- 'f861b18f4446c43918c8643dcbbd7f6d'
- '96f82c38f3f540b53f3e5144900acf17')
+ 'a2a88b3a3257c3b5fd3edcc169e6aca4'
+ '8fe27d4248cacbc02824e7937cab4088'
+ 'df0c367c0022e3c7d8e01827e8a6c5e7'
+ 'f30c2a161caaf27854581507cde8cac6'
+ '5117f65342fcc69c6a506529e4daca9e'
+ '9247e218eea94ebda0aebc8ee0e77db8'
+ '52675e2d7a7f77005f1fc0212b86dbe3'
+ 'cb58bf4e0b80eaee383712e5c84a1ab4'
+ 'b578bcd17949a7203237ba1e31f78ef9'
+ '0becd6ab8782b97f19a02c1dc174c75e'
+ 'f1f0ee65296d438a8c83467ff03f652d')
build() {
cd ${srcdir}/${pkgbase}-${pkgver}
@@ -40,6 +67,36 @@ build() {
# don't zip man pages in make install, let makepkg do that / Fedora
patch -Np1 -i ${srcdir}/cups-no-gzip-man.patch
+
+
+ # various bugfixes (upstream reports/SVN or Fedora/Debian
+
+ # Ensure attributes are valid UTF-8 in dbus notifier
+ patch -Np1 -i ${srcdir}/cups-dbus-utf8.patch
+
+ # More USB quirks for the libusb-based backend (STR #4311)
+ # Fixed in 1.6.3
+ patch -Np1 -i ${srcdir}/usb-backend-more-quirk-rules.patch
+ # Fixed crash which sometimes happens on shutdown of the CUPS daemon, caused by a wrong shutdown sequence for shutting down the Avahi threaded poll.
+ patch -Np1 -i ${srcdir}/cupsd-no-crash-on-avahi-threaded-poll-shutdown.patch
+ # Applications could not get the PPD file for statically-configured IPP-shared print queues
+ patch -Np1 -i ${srcdir}/get-ppd-file-for-statically-configured-ipp-shared-queues.patch
+ # If an external server is used via client.conf and the DNS is inconsistent (ex: DNS gives "noname" for many IPs, reverse DNS gives one of these IPs
+ # for "noname") local PPDs can get polled for print queues instead of the PPDs of the external server Bug: http://www.cups.org/str.php?L2763
+ patch -Np1 -i ${srcdir}/ppd-poll-with-client-conf.patch
+ # Add more error handling to the libusb-based USB backend, especially to avoid a crash when USB is disabled in the BIOS. Also
+ # discard that error when counting warning messages.
+ patch -Np1 -i ${srcdir}/usb-backend-do-not-crash-if-usb-disabled-in-bios.patch
+ # fix permissions on some files - alternative: cups-0755.patch by FC
+ patch -Np0 -i ${srcdir}/cups-1.6.0-fix-install-perms.patch
+ # move /var/run -> /run for pid file
+ patch -Np1 -i ${srcdir}/cups-1.6.2-statedir.patch
+ # Re-initialise the resolver on failure in httpAddrGetList()
+ patch -Np1 -i ${srcdir}/cups-res_init.patch
+ # Use IP address when resolving DNSSD URIs
+ patch -Np1 -i ${srcdir}/cups-avahi-address.patch
+ # Return from cupsEnumDests() once all records have been returned.
+ patch -Np1 -i ${srcdir}/cups-enum-all.patch
# Rebuild configure script for not zipping man-pages.
aclocal -I config-scripts
diff --git a/extra/cups/cups-1.6.0-fix-install-perms.patch b/extra/cups/cups-1.6.0-fix-install-perms.patch
new file mode 100644
index 000000000..2d7a77c44
--- /dev/null
+++ b/extra/cups/cups-1.6.0-fix-install-perms.patch
@@ -0,0 +1,25 @@
+Index: Makedefs.in
+===================================================================
+--- Makedefs.in (Revision 10520)
++++ Makedefs.in (Arbeitskopie)
+@@ -40,14 +40,14 @@
+ # Installation programs...
+ #
+
+-INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
+-INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
++INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@
++INSTALL_COMPDATA = $(INSTALL) -c -m 644 @INSTALL_GZIP@
+ INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
+-INSTALL_DATA = $(INSTALL) -c -m 444
++INSTALL_DATA = $(INSTALL) -c -m 644
+ INSTALL_DIR = $(INSTALL) -d
+-INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
+-INSTALL_MAN = $(INSTALL) -c -m 444
+-INSTALL_SCRIPT = $(INSTALL) -c -m 555
++INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@
++INSTALL_MAN = $(INSTALL) -c -m 644
++INSTALL_SCRIPT = $(INSTALL) -c -m 755
+
+ #
+ # Default user, group, and system groups for the scheduler...
diff --git a/extra/cups/cups-1.6.2-statedir.patch b/extra/cups/cups-1.6.2-statedir.patch
new file mode 100644
index 000000000..3e836657d
--- /dev/null
+++ b/extra/cups/cups-1.6.2-statedir.patch
@@ -0,0 +1,12 @@
+diff -ruN cups-1.6.2.orig/config-scripts/cups-directories.m4 cups-1.6.2/config-scripts/cups-directories.m4
+--- cups-1.6.2.orig/config-scripts/cups-directories.m4 2012-10-01 03:55:23.000000000 +0200
++++ cups-1.6.2/config-scripts/cups-directories.m4 2013-04-02 00:11:41.000000000 +0200
+@@ -429,7 +429,7 @@
+ ;;
+ *)
+ # All others
+- CUPS_STATEDIR="$localstatedir/run/cups"
++ CUPS_STATEDIR="/run/cups"
+ ;;
+ esac
+ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
diff --git a/extra/cups/cups-avahi-address.patch b/extra/cups/cups-avahi-address.patch
new file mode 100644
index 000000000..a03d1adbb
--- /dev/null
+++ b/extra/cups/cups-avahi-address.patch
@@ -0,0 +1,75 @@
+diff -up cups-1.6.2/cups/http-support.c.avahi-address cups-1.6.2/cups/http-support.c
+--- cups-1.6.2/cups/http-support.c.avahi-address 2013-03-11 18:44:36.000000000 +0000
++++ cups-1.6.2/cups/http-support.c 2013-04-04 15:39:06.651847041 +0100
+@@ -2121,7 +2121,7 @@ http_resolve_cb(
+ const char *type, /* I - Registration type */
+ const char *domain, /* I - Domain (unused) */
+ const char *hostTarget, /* I - Hostname */
+- const AvahiAddress *address, /* I - Address (unused) */
++ const AvahiAddress *address, /* I - Address */
+ uint16_t port, /* I - Port number */
+ AvahiStringList *txt, /* I - TXT record */
+ AvahiLookupResultFlags flags, /* I - Lookup flags (unused) */
+@@ -2253,36 +2253,37 @@ http_resolve_cb(
+
+ DEBUG_printf(("8http_resolve_cb: Looking up \"%s\".", hostTarget));
+
+- snprintf(fqdn, sizeof(fqdn), "%d", ntohs(port));
+- if ((addrlist = httpAddrGetList(hostTarget, AF_UNSPEC, fqdn)) != NULL)
++ int error = getnameinfo(&(address->data),
++ address->proto == AVAHI_PROTO_INET ?
++ sizeof (AvahiIPv4Address) :
++ (address->proto == AVAHI_PROTO_INET6 ?
++ sizeof (AvahiIPv6Address) :
++ sizeof (address->data)),
++ fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
++
++ if (!error)
+ {
+- for (addr = addrlist; addr; addr = addr->next)
++ DEBUG_printf(("8http_resolve_cb: Found \"%s\".", fqdn));
++
++ if ((hostptr = fqdn + strlen(fqdn) - 6) <= fqdn ||
++ _cups_strcasecmp(hostptr, ".local"))
+ {
+- int error = getnameinfo(&(addr->addr.addr),
+- httpAddrLength(&(addr->addr)),
+- fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
+-
+- if (!error)
+- {
+- DEBUG_printf(("8http_resolve_cb: Found \"%s\".", fqdn));
+-
+- if ((hostptr = fqdn + strlen(fqdn) - 6) <= fqdn ||
+- _cups_strcasecmp(hostptr, ".local"))
+- {
+- hostTarget = fqdn;
+- break;
+- }
+- }
++ hostTarget = fqdn;
++ }
++ }
+ #ifdef DEBUG
+- else
+- DEBUG_printf(("8http_resolve_cb: \"%s\" did not resolve: %d",
+- httpAddrString(&(addr->addr), fqdn, sizeof(fqdn)),
+- error));
++ else
++ DEBUG_printf(("8http_resolve_cb: \"%s\" did not resolve: %d",
++ httpAddrString(&(addr->addr), fqdn, sizeof(fqdn)),
++ error));
+ #endif /* DEBUG */
+- }
++ } else {
++ /*
++ * Use the IP address that responded...
++ */
+
+- httpAddrFreeList(addrlist);
+- }
++ avahi_address_snprint (fqdn, sizeof (fqdn), address);
++ hostTarget = fqdn;
+ }
+
+ /*
diff --git a/extra/cups/cups-dbus-utf8.patch b/extra/cups/cups-dbus-utf8.patch
new file mode 100644
index 000000000..0bcd4a163
--- /dev/null
+++ b/extra/cups/cups-dbus-utf8.patch
@@ -0,0 +1,106 @@
+diff -up cups-1.6.1/notifier/dbus.c.dbus-utf8 cups-1.6.1/notifier/dbus.c
+--- cups-1.6.1/notifier/dbus.c.dbus-utf8 2012-01-20 19:00:32.000000000 +0000
++++ cups-1.6.1/notifier/dbus.c 2012-10-31 11:04:47.686973616 +0000
+@@ -31,6 +31,9 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <unistd.h>
++#include <assert.h>
++#include <locale.h>
++#include <wchar.h>
+
+ #ifdef HAVE_DBUS
+ # include <dbus/dbus.h>
+@@ -157,10 +160,82 @@ enum
+ * Local functions...
+ */
+
+-static int acquire_lock(int *fd, char *lockfile, size_t locksize);
++static int acquire_lock(int *fd, char *lockfile, size_t locksize);
++static const char *validate_utf8(const char *str);
+
+
+ /*
++ * 'validate_utf8()' - Convert to valid UTF-8
++ */
++
++static const char *
++validate_utf8 (const char *str)
++{
++ static char *buffer = NULL;
++ static size_t buflen = 0;
++ char *p;
++ size_t str_len;
++ unsigned int i;
++ mbstate_t instate, outstate;
++
++ if (str == NULL)
++ {
++ free (buffer);
++ return (NULL);
++ }
++
++ /* Is it already valid? */
++ if (mbstowcs (NULL, str, 0) != (size_t) -1)
++ return str;
++
++ /* Make sure our buffer is at least as large as the input string */
++ str_len = strlen (str);
++ if (str_len > buflen)
++ {
++ if (buffer == NULL)
++ /* Set encoding type to UTF-8 the first time we need to */
++ setlocale (LC_CTYPE, "en_US.UTF-8");
++
++ buflen = str_len + 1;
++ buffer = realloc (buffer, buflen);
++ }
++
++ memset (&instate, '\0', sizeof (mbstate_t));
++ memset (&outstate, '\0', sizeof (mbstate_t));
++ p = buffer;
++ i = 0;
++ while (i < str_len)
++ {
++ wchar_t wc;
++ size_t used, written;
++ mbstate_t orig_instate = instate;
++ used = mbrtowc (&wc, str + i, str_len - i, &instate);
++ switch (used)
++ {
++ case (size_t) -2:
++ case (size_t) -1:
++ wc = L'?'; /* so replacement is never longer than original char */
++ instate = orig_instate;
++ /* fallthru */
++ case 0:
++ used = 1;
++ }
++
++ written = wcrtomb (p, wc, &outstate);
++ if (written != -1)
++ {
++ p += written;
++ assert (p - buffer < buflen);
++ }
++
++ i += used;
++ }
++
++ *p = '\0';
++ return buffer;
++}
++
++/*
+ * 'main()' - Read events and send DBUS notifications.
+ */
+
+@@ -366,7 +441,7 @@ main(int argc, /* I - Number of comm
+ attr = ippFindAttribute(msg, "notify-text", IPP_TAG_TEXT);
+ if (attr)
+ {
+- const char *val = ippGetString(attr, 0, NULL);
++ const char *val = validate_utf8 (ippGetString(attr, 0, NULL));
+ if (!dbus_message_iter_append_string(&iter, &val))
+ goto bail;
+ }
diff --git a/extra/cups/cups-enum-all.patch b/extra/cups/cups-enum-all.patch
new file mode 100644
index 000000000..0ac39835e
--- /dev/null
+++ b/extra/cups/cups-enum-all.patch
@@ -0,0 +1,17 @@
+diff -up cups-1.6.2/cups/dest.c.enum-all cups-1.6.2/cups/dest.c
+--- cups-1.6.2/cups/dest.c.enum-all 2013-06-04 10:58:36.169786250 +0100
++++ cups-1.6.2/cups/dest.c 2013-06-04 10:59:02.147900811 +0100
+@@ -2724,9 +2724,12 @@ cups_dnssd_browse_cb(
+ break;
+
+ case AVAHI_BROWSER_REMOVE:
+- case AVAHI_BROWSER_ALL_FOR_NOW:
+ case AVAHI_BROWSER_CACHE_EXHAUSTED:
+ break;
++
++ case AVAHI_BROWSER_ALL_FOR_NOW:
++ avahi_simple_poll_quit(data->simple_poll);
++ break;
+ }
+ }
+
diff --git a/extra/cups/cups-res_init.patch b/extra/cups/cups-res_init.patch
new file mode 100644
index 000000000..94a81a457
--- /dev/null
+++ b/extra/cups/cups-res_init.patch
@@ -0,0 +1,26 @@
+diff -up cups-1.6b1/cups/http-addr.c.res_init cups-1.6b1/cups/http-addr.c
+--- cups-1.6b1/cups/http-addr.c.res_init 2012-05-17 00:57:03.000000000 +0200
++++ cups-1.6b1/cups/http-addr.c 2012-05-25 15:51:51.323916352 +0200
+@@ -254,7 +254,8 @@ httpAddrLookup(
+
+ if (error)
+ {
+- if (error == EAI_FAIL)
++ if (error == EAI_FAIL || error == EAI_AGAIN || error == EAI_NODATA ||
++ error == EAI_NONAME)
+ cg->need_res_init = 1;
+
+ return (httpAddrString(addr, name, namelen));
+diff -up cups-1.6b1/cups/http-addrlist.c.res_init cups-1.6b1/cups/http-addrlist.c
+--- cups-1.6b1/cups/http-addrlist.c.res_init 2012-04-23 19:26:57.000000000 +0200
++++ cups-1.6b1/cups/http-addrlist.c 2012-05-25 16:05:05.930377452 +0200
+@@ -540,7 +540,8 @@ httpAddrGetList(const char *hostname, /*
+ }
+ else
+ {
+- if (error == EAI_FAIL)
++ if (error == EAI_FAIL || error == EAI_AGAIN || error == EAI_NODATA ||
++ error == EAI_NONAME)
+ cg->need_res_init = 1;
+
+ _cupsSetError(IPP_INTERNAL_ERROR, gai_strerror(error), 0);
diff --git a/extra/cups/cupsd-no-crash-on-avahi-threaded-poll-shutdown.patch b/extra/cups/cupsd-no-crash-on-avahi-threaded-poll-shutdown.patch
new file mode 100644
index 000000000..ee36936f8
--- /dev/null
+++ b/extra/cups/cupsd-no-crash-on-avahi-threaded-poll-shutdown.patch
@@ -0,0 +1,19 @@
+Description: Fixed crash which sometimes happens on shutdown of the CUPS
+ daemon, caused by a wrong shutdown sequence for shutting down the Avahi
+ threaded poll.
+Author: Till Kamppeter <till.kamppeter@gmail.com>
+Bug-Upstream: http://cups.org/str.php?L4180
+Bug-Upstream: http://cups.org/str.php?L4213
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1034045
+Last-Updated: 2012-10-16
+
+--- a/scheduler/dirsvc.c
++++ b/scheduler/dirsvc.c
+@@ -1333,6 +1333,7 @@
+ DNSSDMaster = NULL;
+
+ # else /* HAVE_AVAHI */
++ avahi_threaded_poll_stop(DNSSDMaster);
+ avahi_client_free(DNSSDClient);
+ DNSSDClient = NULL;
+
diff --git a/extra/cups/get-ppd-file-for-statically-configured-ipp-shared-queues.patch b/extra/cups/get-ppd-file-for-statically-configured-ipp-shared-queues.patch
new file mode 100644
index 000000000..ed132d750
--- /dev/null
+++ b/extra/cups/get-ppd-file-for-statically-configured-ipp-shared-queues.patch
@@ -0,0 +1,31 @@
+Description: Applications could not get the PPD file for
+ statically-configured IPP-shared print queues
+Author: Till Kamppeter <till.kamppeter@gmail.com>
+Bug-Upstream: http://cups.org/str.php?L4178
+Last-Updated: 2012-09-19
+
+--- a/cups/util.c
++++ b/cups/util.c
+@@ -1731,6 +1731,22 @@
+
+ return (1);
+ }
++ else if (device_uri &&
++ (!strncmp(device_uri, "ipp:", 4) != NULL ||
++ !strncmp(device_uri, "ipps:", 5) != NULL))
++ {
++ /*
++ * Statically-configured IPP shared printer.
++ */
++
++ httpSeparateURI(HTTP_URI_CODING_ALL,
++ device_uri,
++ scheme, sizeof(scheme), username, sizeof(username),
++ host, hostsize, port, resource, resourcesize);
++ ippDelete(response);
++
++ return (1);
++ }
+ else if ((attr = ippFindAttribute(response, "member-uris",
+ IPP_TAG_URI)) != NULL)
+ {
diff --git a/extra/cups/ppd-poll-with-client-conf.patch b/extra/cups/ppd-poll-with-client-conf.patch
new file mode 100644
index 000000000..8985fa3be
--- /dev/null
+++ b/extra/cups/ppd-poll-with-client-conf.patch
@@ -0,0 +1,23 @@
+Description: If an external server is used via client.conf and the DNS is inconsistent (ex: DNS gives "noname" for many IPs, reverse DNS gives one of these IPs for "noname") local PPDs can get polled for print queues instead of the PPDs of the external server
+Bug: http://www.cups.org/str.php?L2763
+
+--- a/cups/util.c
++++ b/cups/util.c
+@@ -1085,11 +1085,13 @@
+ http2 = http;
+ else if ((http2 = httpConnectEncrypt(hostname, port,
+ cupsEncryption())) == NULL)
+- {
+- DEBUG_puts("1cupsGetPPD3: Unable to connect to server");
++ if ((http2 = httpConnectEncrypt(http_hostname, http_port,
++ cupsEncryption())) == NULL)
++ {
++ DEBUG_puts("1cupsGetPPD3: Unable to connect to server");
+
+- return (HTTP_SERVICE_UNAVAILABLE);
+- }
++ return (HTTP_SERVICE_UNAVAILABLE);
++ }
+
+ /*
+ * Get a temp file...
diff --git a/extra/cups/usb-backend-do-not-crash-if-usb-disabled-in-bios.patch b/extra/cups/usb-backend-do-not-crash-if-usb-disabled-in-bios.patch
new file mode 100644
index 000000000..711dab8ce
--- /dev/null
+++ b/extra/cups/usb-backend-do-not-crash-if-usb-disabled-in-bios.patch
@@ -0,0 +1,54 @@
+Description: Add more error handling to the libusb-based USB backend,
+ especially to avoid a crash when USB is disabled in the BIOS. Also
+ discard that error when counting warning messages.
+Author: Till Kamppeter <till.kamppeter@gmail.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1108719
+Last-Update: 2013-05-03
+--- a/backend/usb-libusb.c
++++ b/backend/usb-libusb.c
+@@ -898,7 +898,8 @@
+ /* Pointer to current alternate setting */
+ const struct libusb_endpoint_descriptor *endpptr = NULL;
+ /* Pointer to current endpoint */
+- ssize_t numdevs, /* number of connected devices */
++ ssize_t err = 0,
++ numdevs, /* number of connected devices */
+ i = 0;
+ uint8_t conf, /* Current configuration */
+ iface, /* Current interface */
+@@ -917,7 +918,13 @@
+ * Initialize libusb...
+ */
+
+- libusb_init(NULL);
++ err = libusb_init(NULL);
++ if (err)
++ {
++ fprintf(stderr, "WARNING: Unable to initialize USB access via libusb, libusb error %i\n", err);
++ return (NULL);
++ }
++
+ numdevs = libusb_get_device_list(NULL, &list);
+ fprintf(stderr, "DEBUG: libusb_get_device_list=%d\n", (int)numdevs);
+
+@@ -1087,7 +1094,8 @@
+ * Clean up ....
+ */
+
+- libusb_free_device_list(list, 1);
++ if (numdevs >= 0)
++ libusb_free_device_list(list, 1);
+ libusb_exit(NULL);
+
+ return (NULL);
+--- a/test/run-stp-tests.sh
++++ b/test/run-stp-tests.sh
+@@ -838,7 +838,7 @@
+ fi
+
+ # Warning log messages
+-count=`$GREP '^W ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
++count=`$GREP '^W ' /tmp/cups-$user/log/error_log | grep -v 'Unable to initialize USB access via libusb, libusb error' | wc -l | awk '{print $1}'`
+ if test $count != 9; then
+ echo "FAIL: $count warning messages, expected 9."
+ $GREP '^W ' /tmp/cups-$user/log/error_log
diff --git a/extra/cups/usb-backend-more-quirk-rules.patch b/extra/cups/usb-backend-more-quirk-rules.patch
new file mode 100644
index 000000000..3b72011d6
--- /dev/null
+++ b/extra/cups/usb-backend-more-quirk-rules.patch
@@ -0,0 +1,66 @@
+Description: USB backend quirk rule for Epson Stylus Photo 750 (and maybe others)
+Author: Didier Raboud <odyx@debian.org>
+Bugs-Debian: http://bugs.debian.org/697970
+Last-Update: 2013-03-11
+
+--- a/backend/usb-libusb.c
++++ b/backend/usb-libusb.c
+@@ -142,8 +142,12 @@
+ { 0x0409, 0xbef4, USBLP_QUIRK_BIDIR }, /* NEC Picty760 (HP OEM) */
+ { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */
+ { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */
++ { 0x043d, 0x00f3, USBLP_QUIRK_NO_REATTACH }, /* Lexmark International,
++ Inc. (e250d), https://bugs.launchpad.net/bugs/1084164 */
+ { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820,
+ by zut <kernel@zut.de> */
++ { 0x04a9, 0x1095, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP6000D
++ Printer, https://bugs.launchpad.net/bugs/1160638 */
+ { 0x04a9, 0x10a2, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4200
+ Printer, http://www.cups.org/str.php?L4155 */
+ { 0x04a9, 0x10b6, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4300
+@@ -158,6 +162,8 @@
+ Printer, http://www.cups.org/str.php?L4155 */
+ { 0x04a9, 0x173e, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP560
+ Printer, http://www.cups.org/str.php?L4155 */
++ { 0x04a9, 0x26a3, USBLP_QUIRK_NO_REATTACH }, /* Canon, Inc. MF4150
++ Printer, https://bugs.launchpad.net/bugs/1160638 */
+ { 0x04f9, 0x001a, USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
+ HL-1430 Laser Printer,
+ https://bugs.launchpad.net/bugs/1038695 */
+@@ -165,24 +171,33 @@
+ USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
+ HL-1440 Laser Printer,
+ https://bugs.launchpad.net/bugs/1000253 */
++ { 0x04f9, 0x000e, USBLP_QUIRK_BIDIR |
++ USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
++ HL-1450 Laser Printer,
++ https://bugs.launchpad.net/bugs/1000253 */
+ { 0x06bc, 0x000b, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp.
+ Okipage 14ex Printer,
+ https://bugs.launchpad.net/bugs/872483 */
+ { 0x06bc, 0x01c7, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp. B410d,
+ https://bugs.launchpad.net/bugs/872483 */
+- { 0x04b8, 0x0001, USBLP_QUIRK_BIDIR }, /* Seiko Epson Corp. Stylus Color 740 / Photo 750,
++ { 0x04b8, 0x0001, USBLP_QUIRK_BIDIR |
++ USBLP_QUIRK_NO_REATTACH }, /* Seiko Epson Corp. Stylus Color 740 / Photo 750,
+ http://bugs.debian.org/697970 */
++ { 0x04b8, 0x0005, USBLP_QUIRK_NO_REATTACH }, /* Seiko Epson Corp. Stylus Color 670,
++ https://bugs.launchpad.net/bugs/872483 */
+ { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt
+ Printer M129C */
+ { 0x067b, 0x2305, USBLP_QUIRK_BIDIR |
+ USBLP_QUIRK_NO_REATTACH |
+ USBLP_QUIRK_RESET },
++ /* Prolific Technology, Inc. PL2305 Parallel Port
++ (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/987485 */
+ { 0x0924, 0x3ce9, USBLP_QUIRK_NO_REATTACH }, /* Xerox Phaser 3124
+ https://bugzilla.redhat.com/show_bug.cgi?id=867392 */
+ { 0x0924, 0x4293, USBLP_QUIRK_NO_REATTACH }, /* Xerox WorkCentre 3210
+ https://bugs.launchpad.net/bugs/1102470 */
+- /* Prolific Technology, Inc. PL2305 Parallel Port
+- (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/987485 */
++ { 0x1a86, 0x7584, USBLP_QUIRK_NO_REATTACH }, /* QinHeng Electronics
++ CH340S (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/1000253 */
+ { 0x04e8, 0x0000, USBLP_QUIRK_RESET }, /* All Samsung devices,
+ https://bugs.launchpad.net/bugs/1032456 */
+ { 0x0a5f, 0x0000, USBLP_QUIRK_BIDIR }, /* All Zebra devices,