Some help with PolicyKit basics

Robert Ancell robert.ancell at gmail.com
Fri Jul 24 00:40:27 PDT 2009


Hi,

I'm trying to learn how to use PolicyKit for configuration of a
server.  Find attached a demo program (which I plan to post as a a
tutorial) which does the following:
- Has a server providing a method "Reflect" which reverses a string
- Has a client with a text entry that uses that uses the server to
reflect entered text
- The client has an "unlock" button that should authorize with the PolKit once

Note I've tried to make the simplest example not the most efficient.

I've been stumbling along for a while and am in need of some help:
- I've used POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION in
polkit_authority_check_authorization_sync to prompt the user for
authentication but sometimes it just blocks for ages instead of
popping up the dialog.  When should I use this flag and when let the
client do the authorization?
- I haven't been able to get the client to manually authorize or have
persistent authorization, how do I do this?
- Any pointers?

The documentation I have been working from:
http://dbus.freedesktop.org/doc/dbus-specification.html
http://hal.freedesktop.org/docs/PolicyKit/
http://people.freedesktop.org/~david/polkit-0.92-newdocs/
http://cgit.freedesktop.org/PolicyKit/tree/docs/PORTING-GUIDE

Thanks,
--Robert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mirror-server.c
Type: text/x-csrc
Size: 3226 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/polkit-devel/attachments/20090724/af9f3111/attachment.c 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mirror-client.c
Type: text/x-csrc
Size: 3532 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/polkit-devel/attachments/20090724/af9f3111/attachment-0001.c 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 529 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/polkit-devel/attachments/20090724/af9f3111/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mirror.policy
Type: application/octet-stream
Size: 640 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/polkit-devel/attachments/20090724/af9f3111/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mirror.conf
Type: application/octet-stream
Size: 419 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/polkit-devel/attachments/20090724/af9f3111/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mirror.xml
Type: text/xml
Size: 329 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/polkit-devel/attachments/20090724/af9f3111/attachment.bin 


More information about the polkit-devel mailing list