Avoid crash with certain types of dnssd device URI (bug #870000).

Resolves: rhbz#870000
This commit is contained in:
Tim Waugh 2012-10-25 17:09:23 +01:00
parent f0dd0b3c7e
commit 2ff5e1e67e
2 changed files with 29 additions and 1 deletions

View File

@ -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")

View File

@ -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@redhat.com> 1.3.12-3
- Avoid crash with certain types of dnssd device URI (bug #870000).
* Tue Oct 23 2012 Tim Waugh <twaugh@redhat.com> 1.3.12-2
- Fixed systemd config file (bug #862186).