[wicd] Do not assume wicd-daemon is running when wicd-client runs (#1074315)

David Cantrell dcantrel at fedoraproject.org
Mon Jun 30 14:35:08 UTC 2014


commit aa678f6fcee0e29a62f0cbaeab3a92e4846d15d4
Author: David Cantrell <dcantrell at redhat.com>
Date:   Mon Jun 30 10:35:02 2014 -0400

    Do not assume wicd-daemon is running when wicd-client runs (#1074315)
    
    - Fix wicd-curses crash on startup (#894646)
    - Edit default D-Bus policy file to allow 'users' group members to run
      wicd client programs (#1074372)

 wicd-1.7.2.4-check-for-daemon.patch                |   17 +++++++
 wicd-1.7.2.4-curses_bz894646.patch                 |   46 ++++++++++++++++++++
 ...-policy.patch => wicd-1.7.2.4-dbus-policy.patch |   35 +++++++++------
 wicd.spec                                          |   22 +++++++++-
 4 files changed, 105 insertions(+), 15 deletions(-)
---
diff --git a/wicd-1.7.2.4-check-for-daemon.patch b/wicd-1.7.2.4-check-for-daemon.patch
new file mode 100644
index 0000000..5ec4731
--- /dev/null
+++ b/wicd-1.7.2.4-check-for-daemon.patch
@@ -0,0 +1,17 @@
+diff -up wicd-1.7.2.4/curses/wicd-curses.py.orig wicd-1.7.2.4/curses/wicd-curses.py
+diff -up wicd-1.7.2.4/gtk/wicd-client.py.orig wicd-1.7.2.4/gtk/wicd-client.py
+--- wicd-1.7.2.4/gtk/wicd-client.py.orig	2012-02-12 05:11:15.000000000 -0500
++++ wicd-1.7.2.4/gtk/wicd-client.py	2014-06-30 10:14:31.170246038 -0400
+@@ -1063,4 +1063,12 @@ def main(argv):
+ 
+ 
+ if __name__ == '__main__':
++    if wireless is None:
++        sys.stderr.write("ERROR: Unable to communicate with wicd daemon.\n\n")
++        sys.stderr.write("Be sure the wicd service is enabled and running:\n")
++        sys.stderr.write("    systemctl enable wicd.service\n")
++        sys.stderr.write("    systemctl start wicd.service\n\n")
++        sys.stderr.write("NOTE: NetworkManager and other network device daemons must be disabled.\n")
++        sys.exit(1)
++
+     main(sys.argv)
diff --git a/wicd-1.7.2.4-curses_bz894646.patch b/wicd-1.7.2.4-curses_bz894646.patch
new file mode 100644
index 0000000..50495bd
--- /dev/null
+++ b/wicd-1.7.2.4-curses_bz894646.patch
@@ -0,0 +1,46 @@
+diff --git a/curses/curses_misc.py b/curses/curses_misc.py
+index a779fa3..99a7db9 100644
+--- a/curses/curses_misc.py
++++ b/curses/curses_misc.py
+@@ -314,9 +314,9 @@ class ComboBox(urwid.WidgetWrap):
+                     #Send key to underlying widget:
+                     self._w.keypress(dim, k)
+ 
+-        #def get_size(self):
+-
+-    def __init__(self,label='',list=[],attrs=('body','editnfc'),focus_attr='focus',use_enter=True,focus=0,callback=None,user_args=None):
++    def __init__(self, label='', list=[], attrs=('body','editnfc'),
++                 focus_attr='focus', use_enter=True, focus=0, callback=None,
++                 user_args=None):
+         """
+         label     : bit of text that preceeds the combobox.  If it is "", then 
+                     ignore it
+@@ -349,7 +349,7 @@ class ComboBox(urwid.WidgetWrap):
+         # We need this to pick our keypresses
+         self.use_enter = use_enter
+ 
+-        self.focus = focus
++        self._focus = focus
+ 
+         self.callback = callback
+         self.user_args = user_args
+@@ -358,6 +358,19 @@ class ComboBox(urwid.WidgetWrap):
+         self.parent = None
+         self.ui = None
+         self.row = None
++
++    @property
++    def focus(self):
++        return self._focus
++
++    @focus.setter
++    def focus(self, index):
++        self._focus = index
++
++    @focus.deleter
++    def focus(self):
++        del self._focus
++
+     def set_list(self,list):
+         self.list = list
+ 
diff --git a/wicd-1.7.0-dbus-policy.patch b/wicd-1.7.2.4-dbus-policy.patch
similarity index 72%
rename from wicd-1.7.0-dbus-policy.patch
rename to wicd-1.7.2.4-dbus-policy.patch
index 9b722ec..866f4d3 100644
--- a/wicd-1.7.0-dbus-policy.patch
+++ b/wicd-1.7.2.4-dbus-policy.patch
@@ -1,7 +1,7 @@
-diff -up wicd-1.7.0/in/other=wicd.conf.in.orig wicd-1.7.0/in/other=wicd.conf.in
---- wicd-1.7.0/in/other=wicd.conf.in.orig	2010-01-14 23:49:11.000000000 -0500
-+++ wicd-1.7.0/in/other=wicd.conf.in	2011-08-11 16:57:20.818332542 -0400
-@@ -7,41 +7,24 @@
+diff -up wicd-1.7.2.4/in/other=wicd.conf.in.dbus wicd-1.7.2.4/in/other=wicd.conf.in
+--- wicd-1.7.2.4/in/other=wicd.conf.in.dbus	2011-09-18 04:48:13.000000000 -0400
++++ wicd-1.7.2.4/in/other=wicd.conf.in	2014-06-30 10:29:35.968246038 -0400
+@@ -7,41 +7,34 @@
                  <allow own="org.wicd.daemon"/>
                  <allow send_destination="org.wicd.daemon"/>
                  <allow send_interface="org.wicd.daemon"/>
@@ -15,27 +15,36 @@ diff -up wicd-1.7.0/in/other=wicd.conf.in.orig wicd-1.7.0/in/other=wicd.conf.in
 +                <allow send_interface="org.wicd.daemon.wired"/>
          </policy>
  
-         <policy context="default">
-                 <deny own="org.wicd.daemon"/>
-         </policy>
- 
+-        <policy context="default">
+-                <deny own="org.wicd.daemon"/>
+-        </policy>
+-
 -	<!-- This Unix group will have permission to use Wicd's gui -->
 -        <policy group="%WICDGROUP%">
--                <allow send_destination="org.wicd.daemon"/>
--                <allow send_interface="org.wicd.daemon"/>
++        <policy group="users">
++                <allow own="org.wicd.daemon"/>
+                 <allow send_destination="org.wicd.daemon"/>
+                 <allow send_interface="org.wicd.daemon"/>
 -                <allow send_interface="org.freedesktop.DBus.Introspectable"/>
 -                <!-- The Introspectable allow shouldn't be needed here, but
 -                     it seems that a few distributions aren't yet allowing
 -                     it in their hal configs, and we need it here, so... -->
--        </policy>
--
++                <allow send_destination="org.wicd.daemon.wireless"/>
++                <allow send_interface="org.wicd.daemon.wireless"/>
++                <allow send_destination="org.wicd.daemon.wired"/>
++                <allow send_interface="org.wicd.daemon.wired"/>
+         </policy>
+ 
 -       <!-- Comment the block below if you do not want all users logged in 
 -            locally to have permission to use wicd-client.  This ignores the 
 -            group based permission model defined above for the "%WICDGROUP%"
 -            group. Note that this only applies if you are using ConsoleKit -
 -            if you do not have ConsoleKit installed and in use, then this
 -            block makes no difference either way.  -->
--
++        <policy context="default">
++                <deny own="org.wicd.daemon"/>
++        </policy>
+ 
          <policy at_console="true">
                  <allow send_destination="org.wicd.daemon"/>
                  <allow send_interface="org.wicd.daemon"/>
diff --git a/wicd.spec b/wicd.spec
index 4fbaf39..08de07d 100644
--- a/wicd.spec
+++ b/wicd.spec
@@ -9,7 +9,7 @@
 
 Name:                wicd
 Version:             1.7.2.4
-Release:             9%{?dist}
+Release:             10%{?dist}
 Summary:             Wireless and wired network connection manager
 
 Group:               System Environment/Base
@@ -20,10 +20,12 @@ Source1:             org.wicd.daemon.service
 
 Patch0:              wicd-1.7.0-remove-WHEREAREMYFILES.patch
 Patch1:              wicd-1.7.1-dbus-failure.patch
-Patch2:              wicd-1.7.0-dbus-policy.patch
+Patch2:              wicd-1.7.2.4-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-check-for-daemon.patch
+Patch7:              wicd-1.7.2.4-curses_bz894646.patch
 
 BuildRoot:           %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
 BuildRequires:       babel
@@ -112,6 +114,16 @@ Client program for wicd that uses a GTK+ interface.
 # For https://bugzilla.redhat.com/show_bug.cgi?id=981667
 %patch5 -p0
 
+# In wicd-client.py (the GTK+ client), make sure we were able to talk to
+# the daemon before running.  If we could not, exit as a failure and explain
+# to the user what they should try.
+# https://bugzilla.redhat.com/show_bug.cgi?id=1074315
+%patch6 -p1
+
+# Fix curses client crash on startup.
+# https://bugzilla.redhat.com/show_bug.cgi?id=894646
+%patch7 -p1
+
 %build
 rm -f po/ast.po
 %{__python} setup.py configure \
@@ -281,6 +293,12 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 %{_datadir}/icons/hicolor/scalable/apps/wicd-gtk.svg
 
 %changelog
+* Mon Jun 30 2014 David Cantrell <dcantrell at redhat.com> - 1.7.2.4-10
+- Do not assume wicd-daemon is running when wicd-client runs (#1074315)
+- Fix wicd-curses crash on startup (#894646)
+- Edit default D-Bus policy file to allow 'users' group members to run
+  wicd client programs (#1074372)
+
 * Sun Jun 08 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.7.2.4-9
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 


More information about the scm-commits mailing list