gnome-lirc-properties r43 - in trunk: . gnome_lirc_properties



Author: hadess
Date: Tue Jul  1 14:33:47 2008
New Revision: 43
URL: http://svn.gnome.org/viewvc/gnome-lirc-properties?rev=43&view=rev

Log:
2008-07-01  Bastien Nocera  <hadess hadess net>

	* gnome_lirc_properties/backend.py: Remove authorization check
	by PID (IsProcessAuthorized) because we were checking the
	backend's PID, which is surely not authorized, and we have
	no way to get to the front-end's PID. Just check with the
	sender's D-Bus name instead (Closes: #540912)



Modified:
   trunk/ChangeLog
   trunk/gnome_lirc_properties/backend.py

Modified: trunk/gnome_lirc_properties/backend.py
==============================================================================
--- trunk/gnome_lirc_properties/backend.py	(original)
+++ trunk/gnome_lirc_properties/backend.py	Tue Jul  1 14:33:47 2008
@@ -64,18 +64,15 @@
             if sender:
                 kit = dbus.SystemBus().get_object('org.freedesktop.PolicyKit', '/')
                 kit = dbus.Interface(kit, 'org.freedesktop.PolicyKit')
-                pid = dbus.UInt32(os.getpid())
-
-                granted = kit.IsProcessAuthorized(action, pid, False)
-                logging.info('process authorization: %r', granted)
-
-                if 'no' == granted:
-                    raise AccessDeniedException('Process not authorized by PolicyKit')
 
+                # Note that we don't use IsProcessAuthorized because we have
+                # no ways to get the PID of the front-end, so we're left
+                # with checking that its bus name is authorised instead
+		# See http://bugzilla.gnome.org/show_bug.cgi?id=540912
                 granted = kit.IsSystemBusNameAuthorized(action, sender, False)
-                logging.info('authorizatoin of system bus name: %r', granted)
+                logging.info('authorization of system bus name \'%s\': %r', sender, granted)
 
-                if 'no' == granted:
+                if 'yes' != granted:
                     raise AccessDeniedException('Session not authorized by PolicyKit')
 
         except AccessDeniedException:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]