PolicyKit: Branch 'master'
Richard Hughes
hughsient at kemper.freedesktop.org
Fri Feb 13 08:12:12 PST 2009
docs/PORTING-GUIDE | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
New commits:
commit e6de4cfa715d78ee41730d8496740138408433d9
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Feb 13 16:11:24 2009 +0000
add a draft version of the porting guide -- WIP
diff --git a/docs/PORTING-GUIDE b/docs/PORTING-GUIDE
new file mode 100644
index 0000000..a89ff78
--- /dev/null
+++ b/docs/PORTING-GUIDE
@@ -0,0 +1,44 @@
+PolicyKit to polkit1 migration notes (DRAFT)
+
+Build files:
+
+⢠Replace polkit-dbus and polkit-grant with polkit-gobject-1 >= 0.91
+⢠There's no polkit-policy-file-validate in 0.91 yet.
+⢠The install directory for *.policy files is now $datadir/polkit-1/actions
+ not $datadir/PolicyKit/policy
+
+Policy files:
+
+⢠There's no more auth_admin_keep_always authorisation. Use auth_admin_keep
+ instead, and rethink what you're trying to achieve.
+ auth_admin_keep is kept for the lifetime of the PolkitSubject.
+⢠If you're getting messages about "action foo is not registered" then check
+ the polkitd-1 daemon output -- it'll print the reason why the policy format
+ is invalid to stdout.
+
+Source files:
+
+⢠Don't include <polkit-dbus/polkit-dbus.h>, only include <polkit/polkit.h>
+⢠No kit_* OOM handling in the new library
+⢠polkit_sysdeps_get_exe_for_pid() doesn't exist anymore, just read contents
+ of /proc/<pid>/cmdline
+⢠PolKitContext is now PolkitAuthority
+⢠PolKitError is now GError
+⢠polkit_bool_t is now gboolean
+⢠PolKitCaller is now PolkitSubject and a lot less powerful, but much quicker
+ to create
+⢠polkit_caller_new_from_dbus_name() to polkit_system_bus_name_new()
+⢠PolKitAction is no more, just use the action_id everywhere.
+⢠polkit_context_is_caller_authorized() to
+ polkit_authority_check_authorization_sync()
+⢠No need to do polkit_context_set_io_watch_functions() and icky
+ g_io_add_watch() stuff to get changes from Polkit
+⢠polkit_context_new() to polkit_authority_get(), and polkit_context_unref() to
+ g_object_unref() as expected
+⢠polkit_caller_get_pid() no longer exists, use
+ http://cgit.freedesktop.org/PolicyKit/tree/src/polkit-dbus/polkit-dbus.c?id=POLICY_KIT_0_9#n417
+⢠polkit_caller_get_uid() no longer exists, use dbus_bus_get_unix_user() as in
+ http://cgit.freedesktop.org/PolicyKit/tree/src/polkit-dbus/polkit-dbus.c?id=POLICY_KIT_0_9#n411
+⢠If you want data about the session from the PolKitContext, you have to ask
+ ConsoleKit directly as in http://cgit.freedesktop.org/PolicyKit/tree/src/polkit-dbus/polkit-dbus.c?id=POLICY_KIT_0_9#n467
+
More information about the hal-commit
mailing list