diff options
author | Pacho Ramos <pacho@gentoo.org> | 2013-03-03 14:48:52 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2013-03-03 14:48:52 +0000 |
commit | 3d7a027a2331e36f69b43d6f0d2b54040cea0788 (patch) | |
tree | 6ca52bc178a8d1bcbbda81f6e8702ed930ac4612 | |
parent | eapi5: define subslot and use slot deps. cosmetics. (diff) | |
download | gentoo-2-3d7a027a2331e36f69b43d6f0d2b54040cea0788.tar.gz gentoo-2-3d7a027a2331e36f69b43d6f0d2b54040cea0788.tar.bz2 gentoo-2-3d7a027a2331e36f69b43d6f0d2b54040cea0788.zip |
Revert Be
(Portage version: 2.1.11.52/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
-rw-r--r-- | net-print/cups-pk-helper/ChangeLog | 9 | ||||
-rw-r--r-- | net-print/cups-pk-helper/cups-pk-helper-0.2.4-r1.ebuild (renamed from net-print/cups-pk-helper/cups-pk-helper-0.2.2.ebuild) | 13 | ||||
-rw-r--r-- | net-print/cups-pk-helper/files/cups-pk-helper-0.2.2-cups-1.6.patch | 340 | ||||
-rw-r--r-- | net-print/cups-pk-helper/files/cups-pk-helper-0.2.4-revert-stricter.patch | 55 |
4 files changed, 69 insertions, 348 deletions
diff --git a/net-print/cups-pk-helper/ChangeLog b/net-print/cups-pk-helper/ChangeLog index ad07756c4533..83b758cf45a5 100644 --- a/net-print/cups-pk-helper/ChangeLog +++ b/net-print/cups-pk-helper/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-print/cups-pk-helper # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-print/cups-pk-helper/ChangeLog,v 1.23 2013/01/06 10:05:35 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-print/cups-pk-helper/ChangeLog,v 1.24 2013/03/03 14:48:52 pacho Exp $ + +*cups-pk-helper-0.2.4-r1 (03 Mar 2013) + + 03 Mar 2013; Pacho Ramos <pacho@gentoo.org> +cups-pk-helper-0.2.4-r1.ebuild, + +files/cups-pk-helper-0.2.4-revert-stricter.patch, + -cups-pk-helper-0.2.2.ebuild, -files/cups-pk-helper-0.2.2-cups-1.6.patch: + Revert Be 06 Jan 2013; Agostino Sarubbo <ago@gentoo.org> cups-pk-helper-0.2.4.ebuild: Add ~sparc, wrt bug #449220 diff --git a/net-print/cups-pk-helper/cups-pk-helper-0.2.2.ebuild b/net-print/cups-pk-helper/cups-pk-helper-0.2.4-r1.ebuild index aec7a08602aa..4ee0b222f47a 100644 --- a/net-print/cups-pk-helper/cups-pk-helper-0.2.2.ebuild +++ b/net-print/cups-pk-helper/cups-pk-helper-0.2.4-r1.ebuild @@ -1,9 +1,8 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-print/cups-pk-helper/cups-pk-helper-0.2.2.ebuild,v 1.12 2012/10/16 02:41:29 mattst88 Exp $ - -EAPI="4" +# $Header: /var/cvsroot/gentoo-x86/net-print/cups-pk-helper/cups-pk-helper-0.2.4-r1.ebuild,v 1.1 2013/03/03 14:48:52 pacho Exp $ +EAPI=5 inherit eutils DESCRIPTION="PolicyKit helper to configure cups with fine-grained privileges" @@ -12,7 +11,7 @@ SRC_URI="http://www.freedesktop.org/software/${PN}/releases/${P}.tar.xz" LICENSE="GPL-2+" SLOT="0" -KEYWORDS="alpha amd64 arm ~ppc ~ppc64 x86" +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86" IUSE="" # Require {glib,gdbus-codegen}-2.30.0 due to GDBus changes between 2.29.92 @@ -32,8 +31,8 @@ DEPEND="${COMMON_DEPEND} src_prepare() { DOCS="AUTHORS HACKING NEWS README" - # bug #428544, https://bugs.freedesktop.org/show_bug.cgi?id=52265 - epatch "${FILESDIR}/${PN}-0.2.2-cups-1.6.patch" + # Revert "Be stricter when validating printer names", bug #459596 + epatch "${FILESDIR}/${P}-revert-stricter.patch" # Regenerate dbus-codegen files to fix build with glib-2.30.x; bug #410773 rm -v src/cph-iface-mechanism.{c,h} || die diff --git a/net-print/cups-pk-helper/files/cups-pk-helper-0.2.2-cups-1.6.patch b/net-print/cups-pk-helper/files/cups-pk-helper-0.2.2-cups-1.6.patch deleted file mode 100644 index c9950b1861b8..000000000000 --- a/net-print/cups-pk-helper/files/cups-pk-helper-0.2.2-cups-1.6.patch +++ /dev/null @@ -1,340 +0,0 @@ -From b72bdab92d4fd89529f76a1188d5961e592f001a Mon Sep 17 00:00:00 2001 -From: Jiri Popelka <jpopelka@redhat.com> -Date: Thu, 19 Jul 2012 15:07:18 +0200 -Subject: [PATCH] Use ippGet/ippSet (accessors) for IPP API. - -CUPS 1.6 makes various structures private and -introduces these ippGet and ippSet functions -for all of the fields in these structures. -http://www.cups.org/str.php?L3928 - -We define our own accessors when CUPS < 1.6. ---- - src/cups.c | 153 ++++++++++++++++++++++++++++++++++++++---------------------- - 1 file changed, 96 insertions(+), 57 deletions(-) - -diff --git a/src/cups.c b/src/cups.c -index 1b2562b..2529f9a 100644 ---- a/src/cups.c -+++ b/src/cups.c -@@ -47,6 +47,45 @@ - - #include "cups.h" - -+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) -+#define HAVE_CUPS_1_6 1 -+#endif -+ -+#ifndef HAVE_CUPS_1_6 -+#define ippGetCount(attr) attr->num_values -+#define ippGetGroupTag(attr) attr->group_tag -+#define ippGetValueTag(attr) attr->value_tag -+#define ippGetName(attr) attr->name -+#define ippGetStatusCode(ipp) ipp->request.status.status_code -+#define ippGetString(attr, element, language) attr->values[element].string.text -+ -+static ipp_attribute_t * -+ippFirstAttribute(ipp_t *ipp) -+{ -+ if (!ipp) -+ return (NULL); -+ return (ipp->current = ipp->attrs); -+} -+ -+static ipp_attribute_t * -+ippNextAttribute(ipp_t *ipp) -+{ -+ if (!ipp || !ipp->current) -+ return (NULL); -+ return (ipp->current = ipp->current->next); -+} -+ -+static int -+ippSetString(ipp_t *ipp, -+ ipp_attribute_t **attr, -+ int element, -+ const char *strvalue) -+{ -+ (*attr)->values[element].string.text = (char *) strvalue; -+ return (1); -+} -+#endif -+ - /* This is 0.1 second */ - #define RECONNECT_DELAY 100000 - /* We try to reconnect during 3 seconds. It's still a fairly long time even for -@@ -560,7 +599,7 @@ _cph_cups_set_error_from_reply (CphCups *cups, - ipp_t *reply) - { - if (reply) -- cups->priv->last_status = reply->request.status.status_code; -+ cups->priv->last_status = ippGetStatusCode (reply); - else - cups->priv->last_status = cupsLastError (); - } -@@ -573,7 +612,7 @@ _cph_cups_is_reply_ok (CphCups *cups, - /* reset the internal status: we'll use the cups status */ - _cph_cups_set_internal_status (cups, NULL); - -- if (reply && reply->request.status.status_code <= IPP_OK_CONFLICT) { -+ if (reply && ippGetStatusCode (reply) <= IPP_OK_CONFLICT) { - cups->priv->last_status = IPP_OK; - return TRUE; - } else { -@@ -767,28 +806,28 @@ _cph_cups_send_new_job_attributes_request (CphCups *cups, - } - - static const char * --_cph_cups_get_attribute_string (ipp_attribute_t *attrs, -+_cph_cups_get_attribute_string (ipp_t *reply, - ipp_tag_t group, - const char *name, - ipp_tag_t type) - { - ipp_attribute_t *attr; - -- for (attr = attrs; attr; attr = attr->next) { -- while (attr && attr->group_tag != group) -- attr = attr->next; -+ for (attr = ippFirstAttribute (reply); attr; attr = ippNextAttribute (reply)) { -+ while (attr && ippGetGroupTag (attr) != group) -+ attr = ippNextAttribute (reply); - - if (attr == NULL) - break; - -- while (attr && attr->group_tag == group) { -- if (attr->name && -- strcmp (attr->name, name) == 0 && -- attr->value_tag == type) { -- return attr->values[0].string.text; -+ while (attr && ippGetGroupTag (attr) == group) { -+ if (ippGetName (attr) && -+ strcmp (ippGetName (attr), name) == 0 && -+ ippGetValueTag (attr) == type) { -+ return ippGetString (attr, 0, NULL); - } - -- attr = attr->next; -+ attr = ippNextAttribute (reply); - } - - if (attr == NULL) -@@ -832,8 +871,8 @@ _cph_cups_class_has_printer (CphCups *cups, - if (!printer_names) - goto out; - -- for (i = 0; i < printer_names->num_values; i++) { -- if (!g_ascii_strcasecmp (printer_names->values[i].string.text, -+ for (i = 0; i < ippGetCount (printer_names); i++) { -+ if (!g_ascii_strcasecmp (ippGetString (printer_names, i, NULL), - printer_name)) { - retval = i; - break; -@@ -877,7 +916,7 @@ _cph_cups_printer_class_set_users (CphCups *cups, - attr = ippAddStrings (request, IPP_TAG_PRINTER, IPP_TAG_NAME, - request_name, len ? len : 1, NULL, NULL); - if (len == 0) -- attr->values[0].string.text = g_strdup (default_value); -+ ippSetString (request, &attr, 0, g_strdup (default_value)); - else { - int i, j; - for (i = 0, j = 0; i < real_len && j < len; i++) { -@@ -885,7 +924,7 @@ _cph_cups_printer_class_set_users (CphCups *cups, - if (users[i][0] == '\0') - continue; - -- attr->values[j].string.text = g_strdup (users[i]); -+ ippSetString (request, &attr, j, g_strdup (users[i])); - j++; - } - } -@@ -903,7 +942,7 @@ _cph_cups_printer_class_set_users (CphCups *cups, - attr = ippAddStrings (request, IPP_TAG_PRINTER, IPP_TAG_NAME, - request_name, len ? len : 1, NULL, NULL); - if (len == 0) -- attr->values[0].string.text = g_strdup (default_value); -+ ippSetString (request, &attr, 0, g_strdup (default_value)); - else { - int i, j; - for (i = 0, j = 0; i < real_len && j < len; i++) { -@@ -911,7 +950,7 @@ _cph_cups_printer_class_set_users (CphCups *cups, - if (users[i][0] == '\0') - continue; - -- attr->values[j].string.text = g_strdup (users[i]); -+ ippSetString (request, &attr, j, g_strdup (users[i])); - j++; - } - } -@@ -1002,7 +1041,7 @@ cph_cups_printer_get_uri (CphCups *cups, - if (!_cph_cups_is_reply_ok (cups, reply, TRUE)) - return NULL; - -- const_uri = _cph_cups_get_attribute_string (reply->attrs, IPP_TAG_PRINTER, -+ const_uri = _cph_cups_get_attribute_string (reply, IPP_TAG_PRINTER, - attrs[0], IPP_TAG_URI); - - uri = NULL; -@@ -1361,7 +1400,7 @@ _cph_cups_devices_get_old (CphCups *cups, - attr = ippAddStrings (request, IPP_TAG_OPERATION, IPP_TAG_NAME, - "include-schemes", len_include, NULL, NULL); - for (i = 0; i < len_include; i++) -- attr->values[i].string.text = g_strdup (include_schemes[i]); -+ ippSetString (request, &attr, i, g_strdup (include_schemes[i])); - } - - if (exclude_schemes && len_exclude > 0) { -@@ -1370,7 +1409,7 @@ _cph_cups_devices_get_old (CphCups *cups, - attr = ippAddStrings (request, IPP_TAG_OPERATION, IPP_TAG_NAME, - "exclude-schemes", len_exclude, NULL, NULL); - for (i = 0; i < len_exclude; i++) -- attr->values[i].string.text = g_strdup (exclude_schemes[i]); -+ ippSetString (request, &attr, i, g_strdup (exclude_schemes[i])); - } - - resource_char = _cph_cups_get_resource (CPH_RESOURCE_ROOT); -@@ -1380,9 +1419,9 @@ _cph_cups_devices_get_old (CphCups *cups, - if (!_cph_cups_is_reply_ok (cups, reply, TRUE)) - return FALSE; - -- for (attr = reply->attrs; attr; attr = attr->next) { -- while (attr && attr->group_tag != IPP_TAG_PRINTER) -- attr = attr->next; -+ for (attr = ippFirstAttribute (reply); attr; attr = ippNextAttribute (reply)) { -+ while (attr && ippGetGroupTag (attr) != IPP_TAG_PRINTER) -+ attr = ippNextAttribute (reply); - - if (attr == NULL) - break; -@@ -1394,29 +1433,29 @@ _cph_cups_devices_get_old (CphCups *cups, - device_make_and_model = NULL; - device_uri = NULL; - -- while (attr && attr->group_tag == IPP_TAG_PRINTER) { -- if (attr->name == NULL) -+ while (attr && ippGetGroupTag (attr) == IPP_TAG_PRINTER) { -+ if (ippGetName (attr) == NULL) - /* nothing, just skip */; -- else if (strcmp (attr->name, "device-class") == 0 && -- attr->value_tag == IPP_TAG_KEYWORD) -- device_class = g_strdup (attr->values[0].string.text); -- else if (strcmp (attr->name, "device-id") == 0 && -- attr->value_tag == IPP_TAG_TEXT) -- device_id = g_strdup (attr->values[0].string.text); -- else if (strcmp (attr->name, "device-info") == 0 && -- attr->value_tag == IPP_TAG_TEXT) -- device_info = g_strdup (attr->values[0].string.text); -- else if (strcmp (attr->name, "device-location") == 0 && -- attr->value_tag == IPP_TAG_TEXT) -- device_location = g_strdup (attr->values[0].string.text); -- else if (strcmp (attr->name, "device-make-and-model") == 0 && -- attr->value_tag == IPP_TAG_TEXT) -- device_make_and_model = g_strdup (attr->values[0].string.text); -- else if (strcmp (attr->name, "device-uri") == 0 && -- attr->value_tag == IPP_TAG_URI) -- device_uri = g_strdup (attr->values[0].string.text); -- -- attr = attr->next; -+ else if (strcmp (ippGetName (attr), "device-class") == 0 && -+ ippGetValueTag (attr) == IPP_TAG_KEYWORD) -+ device_class = g_strdup (ippGetString (attr, 0, NULL)); -+ else if (strcmp (ippGetName (attr), "device-id") == 0 && -+ ippGetValueTag (attr) == IPP_TAG_TEXT) -+ device_id = g_strdup (ippGetString (attr, 0, NULL)); -+ else if (strcmp (ippGetName (attr), "device-info") == 0 && -+ ippGetValueTag (attr) == IPP_TAG_TEXT) -+ device_info = g_strdup (ippGetString (attr, 0, NULL)); -+ else if (strcmp (ippGetName (attr), "device-location") == 0 && -+ ippGetValueTag (attr) == IPP_TAG_TEXT) -+ device_location = g_strdup (ippGetString (attr, 0, NULL)); -+ else if (strcmp (ippGetName (attr), "device-make-and-model") == 0 && -+ ippGetValueTag (attr) == IPP_TAG_TEXT) -+ device_make_and_model = g_strdup (ippGetString (attr, 0, NULL)); -+ else if (strcmp (ippGetName (attr), "device-uri") == 0 && -+ ippGetValueTag (attr) == IPP_TAG_URI) -+ device_uri = g_strdup (ippGetString (attr, 0, NULL)); -+ -+ attr = ippNextAttribute (reply); - } - - if (device_uri) -@@ -1758,7 +1797,7 @@ cph_cups_class_add_printer (CphCups *cups, - printer_uris = ippFindAttribute (reply, - "member-uris", IPP_TAG_URI); - if (printer_uris) -- new_len += printer_uris->num_values; -+ new_len += ippGetCount (printer_uris); - } else - printer_uris = NULL; - -@@ -1768,14 +1807,14 @@ cph_cups_class_add_printer (CphCups *cups, - if (printer_uris) { - int i; - -- for (i = 0; i < printer_uris->num_values; i++) -- attr->values[i].string.text = g_strdup (printer_uris->values[i].string.text); -+ for (i = 0; i < ippGetCount (printer_uris); i++) -+ ippSetString (request, &attr, i, g_strdup (ippGetString (printer_uris, i, NULL))); - } - - if (reply) - ippDelete (reply); - -- attr->values[new_len - 1].string.text = g_strdup (printer_uri); -+ ippSetString (request, &attr, new_len - 1, g_strdup (printer_uri)); - - return _cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN); - } -@@ -1827,7 +1866,7 @@ cph_cups_class_delete_printer (CphCups *cups, - printer_uris = ippFindAttribute (reply, - "member-uris", IPP_TAG_URI); - if (printer_uris) -- new_len += printer_uris->num_values; -+ new_len += ippGetCount (printer_uris); - - /* empty class: we delete it */ - if (new_len <= 0) { -@@ -1847,9 +1886,9 @@ cph_cups_class_delete_printer (CphCups *cups, - - /* copy all printers from the class, except the one we remove */ - for (i = 0; i < printer_index; i++) -- attr->values[i].string.text = g_strdup (printer_uris->values[i].string.text); -- for (i = printer_index + 1; i < printer_uris->num_values; i++) -- attr->values[i].string.text = g_strdup (printer_uris->values[i].string.text); -+ ippSetString (request, &attr, i, g_strdup (ippGetString (printer_uris, i, NULL))); -+ for (i = printer_index + 1; i < ippGetCount (printer_uris); i++) -+ ippSetString (request, &attr, i, g_strdup (ippGetString (printer_uris, i, NULL))); - - ippDelete (reply); - -@@ -2146,7 +2185,7 @@ cph_cups_printer_class_set_option_default (CphCups *cups, - option_name, len, NULL, NULL); - - for (i = 0; i < len; i++) -- attr->values[i].string.text = g_strdup (values[i]); -+ ippSetString (request, &attr, i, g_strdup (values[i])); - } - - retval = _cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN); -@@ -2371,7 +2410,7 @@ cph_cups_printer_class_set_option (CphCups *cups, - option, len, NULL, NULL); - - for (i = 0; i < len; i++) -- attr->values[i].string.text = g_strdup (values[i]); -+ ippSetString (request, &attr, i, g_strdup (values[i])); - } - - if (newppdfile) { -@@ -2490,7 +2529,7 @@ cph_cups_job_get_status (CphCups *cups, - if (!_cph_cups_is_reply_ok (cups, reply, TRUE)) - return CPH_JOB_STATUS_INVALID; - -- orig_user = _cph_cups_get_attribute_string (reply->attrs, IPP_TAG_JOB, -+ orig_user = _cph_cups_get_attribute_string (reply, IPP_TAG_JOB, - attrs[0], IPP_TAG_NAME); - - status = CPH_JOB_STATUS_INVALID; --- -1.7.10.4 - diff --git a/net-print/cups-pk-helper/files/cups-pk-helper-0.2.4-revert-stricter.patch b/net-print/cups-pk-helper/files/cups-pk-helper-0.2.4-revert-stricter.patch new file mode 100644 index 000000000000..d20e3484baea --- /dev/null +++ b/net-print/cups-pk-helper/files/cups-pk-helper-0.2.4-revert-stricter.patch @@ -0,0 +1,55 @@ +From f00aee0b43c31e94087668b23b72e873c660de5e Mon Sep 17 00:00:00 2001 +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. +--- +diff --git a/src/cups.c b/src/cups.c +index 96c2c20..09f0e7b 100644 +--- a/src/cups.c ++++ b/src/cups.c +@@ -327,25 +327,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; + } + +-- +cgit v0.9.0.2-2-gbebe |