Debian Codegraph @

docs/PORTING-GUIDE

raw
1 PolicyKit to polkit1 migration notes (DRAFT)
2
3 Build files:
4
5 • Replace polkit-dbus and polkit-grant with polkit-gobject-1 >= 0.91
6 • There's no polkit-policy-file-validate in 0.91 yet.
7 • The install directory for *.policy files is now $datadir/polkit-1/actions
8 not $datadir/PolicyKit/policy
9
10 Policy files:
11
12 • There's no more auth_admin_keep_always authorisation. Use auth_admin_keep
13 instead, and rethink what you're trying to achieve.
14 auth_admin_keep is kept for the lifetime of the PolkitSubject.
15 • If you're getting messages about "action foo is not registered" then check
16 the polkitd-1 daemon output -- it'll print the reason why the policy format
17 is invalid to stdout.
18
19 Source files:
20
21 • Don't include <polkit-dbus/polkit-dbus.h>, only include <polkit/polkit.h>
22 • No kit_* OOM handling in the new library
23 • polkit_sysdeps_get_exe_for_pid() doesn't exist anymore, just read contents
24 of /proc/<pid>/cmdline
25 • PolKitContext is now PolkitAuthority
26 • PolKitError is now GError
27 • polkit_bool_t is now gboolean
28 • PolKitCaller is now PolkitSubject and a lot less powerful, but much quicker
29 to create
30 • polkit_caller_new_from_dbus_name() to polkit_system_bus_name_new()
31 • PolKitAction is no more, just use the action_id everywhere.
32 • polkit_context_is_caller_authorized() to
33 polkit_authority_check_authorization_sync()
34 • No need to do polkit_context_set_io_watch_functions() and icky
35 g_io_add_watch() stuff to get changes from Polkit
36 • polkit_context_new() to polkit_authority_get(), and polkit_context_unref() to
37 g_object_unref() as expected
38 • polkit_caller_get_pid() no longer exists, use
39 http://cgit.freedesktop.org/PolicyKit/tree/src/polkit-dbus/polkit-dbus.c?id=POLICY_KIT_0_9#n417
40 • polkit_caller_get_uid() no longer exists, use dbus_bus_get_unix_user() as in
41 http://cgit.freedesktop.org/PolicyKit/tree/src/polkit-dbus/polkit-dbus.c?id=POLICY_KIT_0_9#n411
42 • If you want data about the session from the PolKitContext, you have to ask
43 ConsoleKit directly as in http://cgit.freedesktop.org/PolicyKit/tree/src/polkit-dbus/polkit-dbus.c?id=POLICY_KIT_0_9#n467
44