forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app-admin/system-config-printer: 1.5.12 version bump
Package-Manager: Portage-2.3.79, Repoman-2.3.18 Signed-off-by: Andreas Sturmlechner <[email protected]>
- Loading branch information
Showing
4 changed files
with
214 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
DIST system-config-printer-1.5.11-patchset-01.tar.xz 6948 BLAKE2B effe29c51cbe74fc72566df65f10ab845c9dc1f40ca2966c40be87e19f98046f34311c24b7bc77f471b840e35b0c8eb7754a7c5464d50335c8ab2e2ed0e79afd SHA512 2501bda0e75ea51cc8e14df6b3746a0ea51618919ef35ace849efeded0cddc49e6e3793142d1cd128ce3ce62c21661d5fdb85b19718df07b87a20f5fc641885b | ||
DIST system-config-printer-1.5.11.tar.xz 949816 BLAKE2B 96b41d64e0aa3494b7fc7ed15ac926d833a046ba2880b36b6f5dd4e7508e2bc1fac4cb52c9940c13cec6e34cb8972fbc11fcd5a7df510296444ca08a23f4cb2b SHA512 cc0a6faec0022092e64de3d7ab28669039c93853c6931d26c264f0035486e09ad0af784833e88ee8e3dc1b6f5be9dcf84144a2a6464dfa9711172966fa6a22b4 | ||
DIST system-config-printer-1.5.12.tar.xz 955756 BLAKE2B 766cc7307382a7b0ab65387650f1568fd5108dae2693dfc93684c6593e28837d513e4c823bf4e07c3ba2123eea8aba0649135020318f06f38633b9837683d7f7 SHA512 c8b0702dcdf99c4e8a19274dd4a3f82d9263bd5f51d0c19edf7d71fb13095f57a35e643ddbe161ffb5805e72bf7da0cb6a3de44a554854390ac05d8e56644c32 |
58 changes: 58 additions & 0 deletions
58
app-admin/system-config-printer/files/system-config-printer-1.5.12-check-for-null.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
From cf9903466c1a2d18a701f3b5e8c7e03483e1244d Mon Sep 17 00:00:00 2001 | ||
From: Zdenek Dohnal <[email protected]> | ||
Date: Mon, 14 Oct 2019 16:39:28 +0200 | ||
Subject: [PATCH] udev-configure-printer: Add checks for NULL | ||
|
||
--- | ||
NEWS | 1 + | ||
udev/udev-configure-printer.c | 12 +++++++++--- | ||
2 files changed, 10 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/NEWS b/NEWS | ||
index f4b774e5c..0b53aa8ef 100644 | ||
--- a/NEWS | ||
+++ b/NEWS | ||
@@ -1,5 +1,6 @@ | ||
1.5.13 changes | ||
-------------- | ||
+- add checks for NULL in udev-configure-printer (Fedora #1761097) | ||
|
||
1.5.12 changes | ||
-------------- | ||
diff --git a/udev/udev-configure-printer.c b/udev/udev-configure-printer.c | ||
index 83092fc21..d753bbeaf 100644 | ||
--- a/udev/udev-configure-printer.c | ||
+++ b/udev/udev-configure-printer.c | ||
@@ -1411,7 +1411,7 @@ for_each_matching_queue (struct device_uris *device_uris, | ||
const char *printer_state_message = NULL; | ||
int state = 0; | ||
size_t i, l; | ||
- char *this_device_uri_n, *device_uri_n; | ||
+ char *this_device_uri_n = NULL, *device_uri_n = NULL; | ||
const char *ps1, *ps2, *pi1, *pi2; | ||
|
||
while (attr && ippGetGroupTag (attr) != IPP_TAG_PRINTER) | ||
@@ -1448,6 +1448,8 @@ for_each_matching_queue (struct device_uris *device_uris, | ||
for (i = 0; i < device_uris->n_uris; i++) | ||
{ | ||
device_uri_n = normalize_device_uri(device_uris->uri[i]); | ||
+ if (this_device_uri_n == NULL || device_uri_n == NULL) | ||
+ goto skip; | ||
/* As for the same device different URIs can come out when the | ||
device is accessed via the usblp kernel module or via low- | ||
level USB (libusb) we cannot simply compare URIs, must | ||
@@ -1512,8 +1514,12 @@ for_each_matching_queue (struct device_uris *device_uris, | ||
firstqueue = 0; | ||
|
||
skip: | ||
- free(device_uri_n); | ||
- free(this_device_uri_n); | ||
+ if (device_uri_n != NULL) | ||
+ free(device_uri_n); | ||
+ device_uri_n = NULL; | ||
+ if (this_device_uri_n != NULL) | ||
+ free(this_device_uri_n); | ||
+ this_device_uri_n = NULL; | ||
if (!attr) | ||
break; | ||
} |
72 changes: 72 additions & 0 deletions
72
...onfig-printer/files/system-config-printer-1.5.12-fix-abrt-in-udev-configure-printer.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
From b9289dfe105bdb502f183f0afe7a115ecae5f2af Mon Sep 17 00:00:00 2001 | ||
From: Zdenek Dohnal <[email protected]> | ||
Date: Fri, 1 Nov 2019 15:55:34 +0100 | ||
Subject: [PATCH] Fix abrt in udev-configure-printer | ||
|
||
The abrt was due invalid free - several printer models have its normalized uri cropped. | ||
The original pointer from strdup() was lost so its freeing was invalid. | ||
--- | ||
udev/udev-configure-printer.c | 21 ++++++++++++++------- | ||
1 file changed, 14 insertions(+), 7 deletions(-) | ||
|
||
diff --git a/udev/udev-configure-printer.c b/udev/udev-configure-printer.c | ||
index d753bbeaf..a44520f9c 100644 | ||
--- a/udev/udev-configure-printer.c | ||
+++ b/udev/udev-configure-printer.c | ||
@@ -1285,7 +1285,8 @@ normalize_device_uri(const char *str_orig) | ||
{ | ||
int i, j; | ||
int havespace = 0; | ||
- char *str; | ||
+ char *str = NULL; | ||
+ char *cropped_str = NULL; | ||
|
||
if (str_orig == NULL) | ||
return NULL; | ||
@@ -1333,7 +1334,11 @@ normalize_device_uri(const char *str_orig) | ||
(strstr(str, "packard ") == str) || | ||
(strstr(str, "apollo ") == str) || | ||
(strstr(str, "usb ") == str)) | ||
- str = strchr(str, ' ') + 1; | ||
+ { | ||
+ cropped_str = strdup(strchr(str, ' ') + 1); | ||
+ free(str); | ||
+ str = cropped_str; | ||
+ } | ||
|
||
return str; | ||
} | ||
@@ -1448,8 +1453,6 @@ for_each_matching_queue (struct device_uris *device_uris, | ||
for (i = 0; i < device_uris->n_uris; i++) | ||
{ | ||
device_uri_n = normalize_device_uri(device_uris->uri[i]); | ||
- if (this_device_uri_n == NULL || device_uri_n == NULL) | ||
- goto skip; | ||
/* As for the same device different URIs can come out when the | ||
device is accessed via the usblp kernel module or via low- | ||
level USB (libusb) we cannot simply compare URIs, must | ||
@@ -1509,17 +1512,21 @@ for_each_matching_queue (struct device_uris *device_uris, | ||
break; | ||
} | ||
} | ||
+ if (device_uri_n != NULL) | ||
+ { | ||
+ free(device_uri_n); | ||
+ device_uri_n = NULL; | ||
+ } | ||
} | ||
|
||
firstqueue = 0; | ||
|
||
skip: | ||
- if (device_uri_n != NULL) | ||
- free(device_uri_n); | ||
- device_uri_n = NULL; | ||
if (this_device_uri_n != NULL) | ||
+ { | ||
free(this_device_uri_n); | ||
this_device_uri_n = NULL; | ||
+ } | ||
if (!attr) | ||
break; | ||
} |
83 changes: 83 additions & 0 deletions
83
app-admin/system-config-printer/system-config-printer-1.5.12.ebuild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Copyright 1999-2019 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=6 | ||
|
||
PYTHON_COMPAT=( python3_{5,6,7} ) | ||
PYTHON_REQ_USE="xml" | ||
inherit gnome2 python-single-r1 systemd | ||
|
||
DESCRIPTION="Graphical user interface for CUPS administration" | ||
HOMEPAGE="https://github.com/OpenPrinting/system-config-printer" | ||
SRC_URI="https://github.com/OpenPrinting/${PN}/releases/download/${PV}/${P}.tar.xz" | ||
|
||
LICENSE="GPL-2+" | ||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86" | ||
SLOT="0" | ||
IUSE="doc gnome-keyring policykit" | ||
REQUIRED_USE="${PYTHON_REQUIRED_USE}" | ||
|
||
# Needs cups running, bug 284005 | ||
RESTRICT="test" | ||
|
||
# Additional unhandled dependencies | ||
# gnome-extra/gnome-packagekit[${PYTHON_USEDEP}] with pygobject:2 ? | ||
# python samba client: smbc | ||
# selinux: needed for troubleshooting | ||
COMMON_DEPEND="${PYTHON_DEPS} | ||
dev-libs/glib:2 | ||
net-print/cups[dbus] | ||
virtual/libusb:1 | ||
>=virtual/udev-172 | ||
x11-libs/gtk+:3[introspection] | ||
x11-libs/libnotify[introspection] | ||
x11-libs/pango[introspection] | ||
" | ||
DEPEND="${COMMON_DEPEND} | ||
app-text/docbook-xml-dtd:4.1.2 | ||
>=app-text/xmlto-0.0.22 | ||
dev-util/desktop-file-utils | ||
dev-util/intltool | ||
sys-devel/gettext | ||
virtual/pkgconfig | ||
doc? ( dev-python/epydoc ) | ||
" | ||
RDEPEND="${COMMON_DEPEND} | ||
dev-python/dbus-python[${PYTHON_USEDEP}] | ||
dev-python/pycairo[${PYTHON_USEDEP}] | ||
dev-python/pycups[${PYTHON_USEDEP}] | ||
dev-python/pygobject:3[${PYTHON_USEDEP}] | ||
dev-python/requests[${PYTHON_USEDEP}] | ||
dev-python/urllib3[${PYTHON_USEDEP}] | ||
gnome-keyring? ( app-crypt/libsecret[introspection] ) | ||
policykit? ( net-print/cups-pk-helper ) | ||
" | ||
|
||
PATCHES=( | ||
"${FILESDIR}"/${P}-check-for-null.patch | ||
"${FILESDIR}"/${P}-fix-abrt-in-udev-configure-printer.patch | ||
) | ||
|
||
pkg_setup() { | ||
python-single-r1_pkg_setup | ||
} | ||
|
||
src_configure() { | ||
gnome2_src_configure \ | ||
--enable-nls \ | ||
--with-desktop-vendor=Gentoo \ | ||
--with-udev-rules \ | ||
--with-systemdsystemunitdir=$(systemd_get_systemunitdir) | ||
} | ||
|
||
src_compile() { | ||
gnome2_src_compile | ||
use doc && emake html | ||
} | ||
|
||
src_install() { | ||
use doc && local HTML_DOCS=( html/. ) | ||
gnome2_src_install | ||
python_fix_shebang "${ED}" | ||
python_optimize | ||
} |