app-admin/system-config-printer: EAPI-7 bump, gnome2--

Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2020-10-24 18:50:26 +02:00
parent 14a30e7403
commit b94cda0602
2 changed files with 55 additions and 69 deletions

View File

@@ -1,58 +1,46 @@
From cf9903466c1a2d18a701f3b5e8c7e03483e1244d Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
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)
From cf9903466c1a2d18a701f3b5e8c7e03483e1244d Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Mon, 14 Oct 2019 16:39:28 +0200
Subject: [PATCH] udev-configure-printer: Add checks for NULL
---
udev/udev-configure-printer.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
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;
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;
}
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;
}

View File

@@ -1,19 +1,19 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
EAPI=7
PYTHON_COMPAT=( python3_{7,8,9} )
PYTHON_REQ_USE="xml"
inherit gnome2 python-single-r1 systemd
inherit python-single-r1 systemd xdg
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 ~sparc ~x86"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="gnome-keyring policykit"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
@@ -68,19 +68,17 @@ pkg_setup() {
}
src_configure() {
gnome2_src_configure \
--enable-nls \
--with-desktop-vendor=Gentoo \
--with-udev-rules \
local myeconfargs=(
--enable-nls
--with-desktop-vendor=Gentoo
--with-udev-rules
--with-systemdsystemunitdir=$(systemd_get_systemunitdir)
}
src_compile() {
gnome2_src_compile
)
econf "${myeconfargs[@]}"
}
src_install() {
gnome2_src_install
default
python_fix_shebang "${ED}"
python_optimize
}