Bug#698016: unblock: cups-pk-helper/0.2.3-2
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
Please unblock package cups-pk-helper
to make printing usable within GNOME. Otherwise many possible
printernames will be considered invalid. The patch itself is
cherry-picked from upsteam.
Cheers,
-- Guido
unblock cups-pk-helper/0.2.3-2
-- System Information:
Debian Release: 7.0
APT prefers testing
APT policy: (990, 'testing'), (50, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 3.2.0-4-686-pae (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru cups-pk-helper-0.2.3/debian/changelog cups-pk-helper-0.2.3/debian/changelog
--- cups-pk-helper-0.2.3/debian/changelog 2012-10-16 20:40:26.000000000 +0200
+++ cups-pk-helper-0.2.3/debian/changelog 2013-01-11 22:20:14.000000000 +0100
@@ -1,3 +1,10 @@
+cups-pk-helper (0.2.3-3) unstable; urgency=low
+
+ * [0e08076] Revert "Be stricter when validating printer names"
+ Thanks to Kjö Hansi Glaz
+
+ -- Guido Günther <agx@sigxcpu.org> Fri, 11 Jan 2013 22:20:14 +0100
+
cups-pk-helper (0.2.3-2) unstable; urgency=low
* [a4c337b] Make sure O_NOFOLLOW can be used. Fixes FTBS on
diff -Nru cups-pk-helper-0.2.3/debian/patches/0003-Revert-Be-stricter-when-validating-printer-names.patch cups-pk-helper-0.2.3/debian/patches/0003-Revert-Be-stricter-when-validating-printer-names.patch
--- cups-pk-helper-0.2.3/debian/patches/0003-Revert-Be-stricter-when-validating-printer-names.patch 1970-01-01 01:00:00.000000000 +0100
+++ cups-pk-helper-0.2.3/debian/patches/0003-Revert-Be-stricter-when-validating-printer-names.patch 2013-01-11 22:19:38.000000000 +0100
@@ -0,0 +1,55 @@
+From: Vincent Untz <vuntz@suse.com>
+Date: Mon, 10 Dec 2012 09:44:31 +0000
+Subject: Revert "Be stricter when validating printer names"
+
+Apparently, this is way too strict. The lpadmin man page says:
+
+ CUPS allows printer names to contain any printable character except
+ SPACE, TAB, "/", or "#".
+
+So the previous code was (mostly) correct.
+
+This reverts commit 7bf9cbe43ef8f648f308e4760f75c2aa6b61fa8e.
+---
+ src/cups.c | 20 +++++++++-----------
+ 1 file changed, 9 insertions(+), 11 deletions(-)
+
+diff --git a/src/cups.c b/src/cups.c
+index f94330a..22f29cb 100644
+--- a/src/cups.c
++++ b/src/cups.c
+@@ -329,25 +329,23 @@ _cph_cups_is_printer_name_valid_internal (const char *name)
+ int i;
+ int len;
+
+- /* Quoting http://www.cups.org/documentation.php/doc-1.1/sam.html#4_1:
+- *
+- * The printer name must start with any printable character except
+- * " ", "/", and "@". It can contain up to 127 letters, numbers, and
+- * the underscore (_).
+- *
+- * The first part is a bit weird, as the second part is more
+- * restrictive. So we only consider the second part. */
+-
+ /* no empty string */
+ if (!name || name[0] == '\0')
+ return FALSE;
+
+ len = strlen (name);
+- if (len > 127)
++ /* no string that is too long; see comment at the beginning of the
++ * validation code block */
++ if (len > CPH_STR_MAXLEN)
+ return FALSE;
+
++ /* only printable characters, no space, no /, no # */
+ for (i = 0; i < len; i++) {
+- if (!g_ascii_isalnum (name[i]) && name[i] != '_')
++ if (!g_ascii_isprint (name[i]))
++ return FALSE;
++ if (g_ascii_isspace (name[i]))
++ return FALSE;
++ if (name[i] == '/' || name[i] == '#')
+ return FALSE;
+ }
+
diff -Nru cups-pk-helper-0.2.3/debian/patches/series cups-pk-helper-0.2.3/debian/patches/series
--- cups-pk-helper-0.2.3/debian/patches/series 2012-10-16 20:39:56.000000000 +0200
+++ cups-pk-helper-0.2.3/debian/patches/series 2013-01-11 22:19:38.000000000 +0100
@@ -1,2 +1,3 @@
0001-Make-sure-O_NOFOLLOW-can-be-used.patch
0002-autoreconf.patch
+0003-Revert-Be-stricter-when-validating-printer-names.patch
Reply to: