polkit-dbus

polkit-dbus — Helper library for obtaining seat, session and caller information via D-Bus and ConsoleKit.

Synopsis




PolKitSession*      polkit_session_new_from_objpath     (DBusConnection *con,
                                                         const char *objpath,
                                                         uid_t uid,
                                                         DBusError *error);
PolKitSession*      polkit_session_new_from_cookie      (DBusConnection *con,
                                                         const char *cookie,
                                                         DBusError *error);
PolKitCaller*       polkit_caller_new_from_dbus_name    (DBusConnection *con,
                                                         const char *dbus_name,
                                                         DBusError *error);
PolKitCaller*       polkit_caller_new_from_pid          (DBusConnection *con,
                                                         pid_t pid,
                                                         DBusError *error);

Description

Helper library for obtaining seat, session and caller information via D-Bus and ConsoleKit.

Details

polkit_session_new_from_objpath ()

PolKitSession*      polkit_session_new_from_objpath     (DBusConnection *con,
                                                         const char *objpath,
                                                         uid_t uid,
                                                         DBusError *error);

This function will construct a PolKitSession object by querying the ConsoleKit daemon for information. Note that this will do a lot of blocking IO so it is best avoided if your process already tracks/caches all the information. If you pass in uid as a non-negative number, a round trip can be saved.

con : D-Bus system bus connection
objpath : object path of ConsoleKit session object
uid : the user owning the session or -1 if unknown
error : D-Bus error
Returns : the new object or NULL if an error occured (in which case error will be set)

polkit_session_new_from_cookie ()

PolKitSession*      polkit_session_new_from_cookie      (DBusConnection *con,
                                                         const char *cookie,
                                                         DBusError *error);

This function will construct a PolKitSession object by querying the ConsoleKit daemon for information. Note that this will do a lot of blocking IO so it is best avoided if your process already tracks/caches all the information.

con : D-Bus system bus connection
cookie : a ConsoleKit XDG_SESSION_COOKIE
error : D-Bus error
Returns : the new object or NULL if an error occured (in which case error will be set)

polkit_caller_new_from_dbus_name ()

PolKitCaller*       polkit_caller_new_from_dbus_name    (DBusConnection *con,
                                                         const char *dbus_name,
                                                         DBusError *error);

This function will construct a PolKitCaller object by querying both the system bus daemon and the ConsoleKit daemon for information. Note that this will do a lot of blocking IO so it is best avoided if your process already tracks/caches all the information.

con : D-Bus system bus connection
dbus_name : unique system bus connection name
error : D-Bus error
Returns : the new object or NULL if an error occured (in which case error will be set)

polkit_caller_new_from_pid ()

PolKitCaller*       polkit_caller_new_from_pid          (DBusConnection *con,
                                                         pid_t pid,
                                                         DBusError *error);

con :
pid :
error :
Returns :