| PolicyKit D-Bus Helper Library Reference Manual | ||||
|---|---|---|---|---|
polkit-dbuspolkit-dbus — Helper library for obtaining seat, session and caller information via D-Bus and ConsoleKit. |
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);
Helper library for obtaining seat, session and caller information via D-Bus and ConsoleKit.
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) |
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) |
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) |