Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
David Cantrell
85d8b6a97d Fix string.translate() usage in misc.py (#1005515) 2014-09-25 16:04:13 -04:00
David Cantrell
e7be2d09e5 Prevent crash when saving network properties (#996693) 2014-07-02 11:26:32 -04:00
David Cantrell
412249b91b Apply upstream patch to fix exception when changing properties in
wicd-gtk (#981667)
2013-12-09 09:30:18 -05:00
David Cantrell
6105ce1a20 systemd_post_with_restart -> systemd_postun_with_restart (#901753) 2013-04-01 14:51:48 -04:00
4 changed files with 90 additions and 2 deletions

16
770_769.diff Normal file
View file

@ -0,0 +1,16 @@
=== modified file 'wicd/misc.py'
--- wicd/misc.py 2012-04-30 19:20:47 +0000
+++ wicd/misc.py 2012-05-03 16:01:49 +0000
@@ -430,7 +430,10 @@
""" Sanitize property names to be used in config-files. """
allowed = string.ascii_letters + '_' + string.digits
table = string.maketrans(allowed, ' ' * len(allowed))
- return s.translate(None, table)
+
+ # s is a dbus.String -- since we don't allow unicode property keys,
+ # make it simple.
+ return str(s).translate(None, table)
def sanitize_escaped(s):
""" Sanitize double-escaped unicode strings. """

View file

@ -0,0 +1,30 @@
diff -up wicd-1.7.2.4/wicd/wicd-daemon.py.sanitize wicd-1.7.2.4/wicd/wicd-daemon.py
--- wicd-1.7.2.4/wicd/wicd-daemon.py.sanitize 2014-07-02 11:24:51.171030709 -0400
+++ wicd-1.7.2.4/wicd/wicd-daemon.py 2014-07-02 11:25:09.780030709 -0400
@@ -1064,7 +1064,7 @@ class WirelessDaemon(dbus.service.Object
def SetWirelessProperty(self, netid, prop, value):
""" Sets property to value in network specified. """
# We don't write script settings here.
- prop = misc.sanitize_config(prop)
+ prop = misc.sanitize_config(str(prop))
if prop.endswith('script'):
print 'Setting script properties through the daemon' \
+ ' is not permitted.'
@@ -1265,7 +1265,7 @@ class WirelessDaemon(dbus.service.Object
@dbus.service.method('org.wicd.daemon.wireless')
def SaveWirelessNetworkProperty(self, id, option):
""" Writes a particular wireless property to disk. """
- option = misc.sanitize_config(option)
+ option = misc.sanitize_config(str(option))
if option.endswith("script"):
print 'You cannot save script information to disk through ' + \
'the daemon.'
@@ -1408,7 +1408,7 @@ class WiredDaemon(dbus.service.Object):
def SetWiredProperty(self, prop, value):
""" Sets the given property to the given value. """
if self.WiredNetwork:
- prop = misc.sanitize_config(prop)
+ prop = misc.sanitize_config(str(prop))
if prop.endswith('script'):
print 'Setting script properties through the daemon' \
+ ' is not permitted.'

View file

@ -0,0 +1,12 @@
diff -up wicd-1.7.2.4/wicd/misc.py.orig wicd-1.7.2.4/wicd/misc.py
--- wicd-1.7.2.4/wicd/misc.py.orig 2014-09-25 15:58:24.170052173 -0400
+++ wicd-1.7.2.4/wicd/misc.py 2014-09-25 16:00:04.175052173 -0400
@@ -433,7 +433,7 @@ def sanitize_config(s):
# s is a dbus.String -- since we don't allow unicode property keys,
# make it simple.
- return str(s).translate(None, table)
+ return str(s).translate(table)
def sanitize_escaped(s):
""" Sanitize double-escaped unicode strings. """

View file

@ -9,7 +9,7 @@
Name: wicd
Version: 1.7.2.4
Release: 5%{?dist}
Release: 9%{?dist}
Summary: Wireless and wired network connection manager
Group: System Environment/Base
@ -23,6 +23,9 @@ Patch1: wicd-1.7.1-dbus-failure.patch
Patch2: wicd-1.7.0-dbus-policy.patch
Patch3: wicd-1.7.1-DaemonClosing.patch
Patch4: wicd-1.7.2.4-unicode.patch
Patch5: 770_769.diff
Patch6: wicd-1.7.2.4-sanitize.patch
Patch7: wicd-1.7.2.4-translate-args.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
BuildRequires: babel
@ -106,6 +109,20 @@ Client program for wicd that uses a GTK+ interface.
# Unicode string handling problems
%patch4 -p1
# Upstream patch:
# http://bazaar.launchpad.net/~wicd-devel/wicd/experimental/revision/770
# For https://bugzilla.redhat.com/show_bug.cgi?id=981667
%patch5 -p0
# Fix crash when trying to save network properties.
# Upstream bug report and patch:
# https://bugs.launchpad.net/wicd/+bug/993912
%patch6 -p1
# translate() on a string requires the table as the first argument
# https://bugzilla.redhat.com/show_bug.cgi?id=1005515
%patch7 -p1
%build
rm -f po/ast.po
%{__python} setup.py configure \
@ -172,7 +189,7 @@ rm -rf %{buildroot}
%systemd_preun wicd.service
%postun common
%systemd_post_with_restart wicd.service
%systemd_postun_with_restart wicd.service
%post gtk
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
@ -275,6 +292,19 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_datadir}/icons/hicolor/scalable/apps/wicd-gtk.svg
%changelog
* Thu Sep 25 2014 David Cantrell <dcantrell@redhat.com> - 1.7.2.4-9
- Fix string.translate() usage in misc.py (#1005515)
* Wed Jul 02 2014 David Cantrell <dcantrell@redhat.com> - 1.7.2.4-8
- Prevent crash when saving network properties (#996693)
* Mon Dec 09 2013 David Cantrell <dcantrell@redhat.com> - 1.7.2.4-7
- Apply upstream patch to fix exception when changing properties in
wicd-gtk (#981667)
* Mon Apr 01 2013 David Cantrell <dcantrell@redhat.com> - 1.7.2.4-6
- systemd_post_with_restart -> systemd_postun_with_restart (#901753)
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.2.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild