Review Request 111093: PolKit Actions KCM: do not crash if policies could not be read

Jonathan Marten jjm at keelhaul.me.uk
Wed Sep 18 09:37:28 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111093/
-----------------------------------------------------------

(Updated Sept. 18, 2013, 8:37 a.m.)


Review request for kde-workspace and Polkit KDE Configuration.


Changes
-------

Adding kde-workspace group.  Ping anyone?


Description
-------

The referenced bug describes a crash in the System Settings - System Administration - Actions Policy module.  The first time that an action is clicked on, an attempt is made to read the current system policy settings via ActionWidget::reloadPKLAs().  Internally this checks the authorisation for the org.kde.polkitkde1.readauthorizations action.  If this action is not allowed, or the authorization fails, then a DBus error is returned - but never checked.  There is then a crash (via qFatal) when an attempt is made to read from the invalid returned QDBusArgument.

Unless the user made a mistake (e.g. typing the root password incorrectly), this indicates a system configuration problem.  However, even if the fix needs to be elsewhere, systemsettings should not just crash with no indication of where the problem lies.

This change checks and reports the DBus error if one is returned.  Nothing can be done within this module if this is the case, but at least there is a diagnostic message.  The widget is left disabled, but will try the authorization again if another action is selected.


This addresses bug 300050.
    http://bugs.kde.org/show_bug.cgi?id=300050


Diffs
-----

  polkitactions/ActionWidget.h ca83bf5 
  polkitactions/ActionWidget.cpp c5785c0 

Diff: http://git.reviewboard.kde.org/r/111093/diff/


Testing
-------

With the default policy in place for org.kde.polkit1.readauthorizations (active session = auth_admin, inactive session = no), run 'kcmshell4 kcm_polkitactions'.  Expand the tree and click on any action.  In the password dialogue, either cancel or enter an incorrect password.  Check that there is no crash and that the message box is displayed.

Click on another action, correctly enter the password and observe that there is no message and policies are displayed as expected.


Thanks,

Jonathan Marten

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20130918/9fd26499/attachment.htm>


More information about the kde-core-devel mailing list