Bug 266467 - kcm_polkitactions doesn't remember changes in implicit authorizations
Summary: kcm_polkitactions doesn't remember changes in implicit authorizations
Status: RESOLVED FIXED
Alias: None
Product: policykit-kde-agent-1
Classification: Plasma
Component: kcm_auth (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Dario Freddi
URL:
Keywords:
: 281043 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-16 16:09 UTC by Lukas Tines
Modified: 2011-11-17 23:48 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fixing explicit authority settings, by fixing several DBUS messaging bugs. (11.24 KB, patch)
2011-08-08 21:11 UTC, tball.aau
Details
DBUS message fixing (4.95 KB, patch)
2011-08-09 18:54 UTC, tball.aau
Details
Added a policy path check. If it does not exist, create a new path. (1.84 KB, patch)
2011-08-09 18:55 UTC, tball.aau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Tines 2011-02-16 16:09:52 UTC
Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

When I change any of the implicit authorizations, hit apply on console i get a lot of "QDBusMarshaller: type `PKLAEntry' (285) is not registered with D-BUS. Use qDBusRegisterMetaType to register it" messages and one "QDBusConnection: error: could not send message to service "org.kde.polkitkde1.helper" path "/Helper" interface "org.kde.polkitkde1.helper" member "writePolicy": Marshalling failed: Unregistered type PKLAEntry passed in arguments". When I start kcm_polkitactions all my changes are lost


Reproducible: Always

Steps to Reproduce:
1. Open kcm_polkitactions
2. Change any of the implicit authorizations for "org.kde.fontinst.manage"
3. Click apply
4. Click somewhere else and then back to "org.kde.fontinst.manage"

Actual Results:  
Implicit authorizations are back to previous state (before change)

Expected Results:  
New settings for implicit authorizations are saved

KDE 4.6.0, PolicyKit 0.9
Comment 1 Todd 2011-02-24 21:12:36 UTC
It doesn't let you change the explicit authorizations, either.  Click "add", add a new policy, leave, then come back and all the policies you added are gone.
Comment 2 Krzysztof Nowicki 2011-03-13 10:00:41 UTC
I got curious about this one and I did some research.

The error message can indeed be observed. It's easy to fix however by adding a qDBusRegisterMetaType<PKLAEntry>() call in the Polkit KCM module constructor.

Unfortunately this still doesn't fix the problem. This time the DBus call is executed, but returns an error: No such method 'writePolicy' in interface 'org.kde.polkitkde1.helper' at object path '/Helper' (signature '')

This looks like QDBus is unable to match the signature of the method from the message to the implementation.

After adding some explicit authorizations a similar error is returned, but with a different signature: No such method 'writePolicy' in interface 'org.kde.polkitkde1.helper' at object path '/Helper' (signature '(ssssssii)(ssssssii)')

I don't know much about DBus and using custom types in QDBus, but I'm really wondering how is all this meant to work at all?
Comment 3 tball.aau 2011-08-08 19:17:55 UTC
I have had a look on this one for the last couple of days, and I have fixed the issues with explicit authorizations.
I really don't know how this could have ever worked?

Some of the things I have fixed in the proposed patch:
- Wrong DBUS message handling
- Added some checks if the configuration directory exists. If not, create it.
- Added some prober QT metatype handling, which didn't work with the new way of sending the configurations over the DBUS.

Implicit configuration still doesn't work, mostly because it doesn't do anything in kcm_polkitactions. I would love to fix it, but I need some informations about where it should save the settings and what it should do.

I will attach the patch later.
Comment 4 tball.aau 2011-08-08 21:11:38 UTC
Created attachment 62685 [details]
Fixing explicit authority settings, by fixing several DBUS messaging bugs.
Comment 5 tball.aau 2011-08-09 18:53:11 UTC
Comment on attachment 62685 [details]
Fixing explicit authority settings, by fixing several DBUS messaging bugs.

I have splitted the patch up and cleaned them up a bit.
Comment 6 tball.aau 2011-08-09 18:54:28 UTC
Created attachment 62707 [details]
DBUS message fixing
Comment 7 tball.aau 2011-08-09 18:55:53 UTC
Created attachment 62708 [details]
Added a policy path check. If it does not exist, create a new path.

The last two patches, is a splitted-up and cleaned-up versions of the original proposed patches.
Comment 8 tball.aau 2011-08-09 22:10:52 UTC
I have polished the patches even further. I got someone to give me some feedback. Bare with me, its my first patch :)

The patches are currently for reviewing:
https://git.reviewboard.kde.org/r/102265/
https://git.reviewboard.kde.org/r/102272/

I will mark my current attachments as obsolete.
Comment 9 tball.aau 2011-09-08 16:04:34 UTC
Fixed in commit 600bd94954c846e9694c303902d6ac7f9bc897fa.
It is now possible to change and save implicit and explicit settings.

The bug report can be marked as fixed.
Comment 10 Will Stephenson 2011-11-17 23:48:08 UTC
*** Bug 281043 has been marked as a duplicate of this bug. ***
Comment 11 Will Stephenson 2011-11-17 23:48:55 UTC
Tested, confirmed fixed.  Thank you!