[system-config-printer] Avoid crash with certain types of dnssd device URI (bug #870000).
Tim Waugh
twaugh at fedoraproject.org
Thu Oct 25 16:22:01 UTC 2012
commit 2ff5e1e67eb80d6325ddabe59ade6358721bc600
Author: Tim Waugh <twaugh at redhat.com>
Date: Thu Oct 25 17:09:23 2012 +0100
Avoid crash with certain types of dnssd device URI (bug #870000).
Resolves: rhbz#870000
system-config-printer-dnssd-crash.patch | 21 +++++++++++++++++++++
system-config-printer.spec | 9 ++++++++-
2 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/system-config-printer-dnssd-crash.patch b/system-config-printer-dnssd-crash.patch
new file mode 100644
index 0000000..f7b5c6b
--- /dev/null
+++ b/system-config-printer-dnssd-crash.patch
@@ -0,0 +1,21 @@
+diff -up system-config-printer-1.3.12/newprinter.py.dnssd-crash system-config-printer-1.3.12/newprinter.py
+--- system-config-printer-1.3.12/newprinter.py.dnssd-crash 2012-10-25 17:07:55.023003721 +0100
++++ system-config-printer-1.3.12/newprinter.py 2012-10-25 17:08:15.522058917 +0100
+@@ -2342,7 +2342,7 @@ class NewPrinterGUI(GtkGUI):
+ (scheme, rest) = urllib.splittype (device.uri)
+ (name, rest) = urllib.splithost (rest)
+ (cupsqueue, rest) = urllib.splitquery (rest)
+- if cupsqueue[0] == '/':
++ if cupsqueue != '' and cupsqueue[0] == '/':
+ cupsqueue = cupsqueue[1:]
+ if cupsqueue == 'cups':
+ device.menuentry = _("Remote CUPS printer via DNS-SD")
+@@ -2493,7 +2493,7 @@ class NewPrinterGUI(GtkGUI):
+ (scheme, rest) = urllib.splittype (device.uri)
+ (name, rest) = urllib.splithost (rest)
+ (cupsqueue, rest) = urllib.splitquery (rest)
+- if cupsqueue[0] == '/':
++ if cupsqueue != '' and cupsqueue[0] == '/':
+ cupsqueue = cupsqueue[1:]
+ if cupsqueue == 'cups':
+ text = _("Remote CUPS printer via DNS-SD")
diff --git a/system-config-printer.spec b/system-config-printer.spec
index ca9b33a..ed5f036 100644
--- a/system-config-printer.spec
+++ b/system-config-printer.spec
@@ -1,7 +1,7 @@
Summary: A printer administration tool
Name: system-config-printer
Version: 1.3.12
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2+
URL: http://cyberelk.net/tim/software/system-config-printer/
Group: System Environment/Base
@@ -9,6 +9,7 @@ Source0: http://cyberelk.net/tim/data/system-config-printer/1.3/%{name}-%{versio
Patch1: system-config-printer-no-applet-in-gnome.patch
Patch2: system-config-printer-FirewallD.patch
Patch3: system-config-printer-systemd.patch
+Patch4: system-config-printer-dnssd-crash.patch
BuildRequires: cups-devel >= 1.2
BuildRequires: desktop-file-utils >= 0.2.92
@@ -72,6 +73,9 @@ printers.
# Fixed systemd config file (bug #862186).
%patch3 -p1 -b .systemd
+# Avoid crash with certain types of dnssd device URI (bug #870000).
+%patch4 -p1 -b .dnssd-crash
+
%build
%configure --with-udev-rules
@@ -171,6 +175,9 @@ touch %buildroot%{_localstatedir}/run/udev-configure-printer/usb-uris
exit 0
%changelog
+* Thu Oct 25 2012 Tim Waugh <twaugh at redhat.com> 1.3.12-3
+- Avoid crash with certain types of dnssd device URI (bug #870000).
+
* Tue Oct 23 2012 Tim Waugh <twaugh at redhat.com> 1.3.12-2
- Fixed systemd config file (bug #862186).
More information about the scm-commits
mailing list