polkit-caller

polkit-caller — Callers on the system message bus.

Synopsis




struct              PolKitCaller;
PolKitCaller*       polkit_caller_new                   (void);
PolKitCaller*       polkit_caller_ref                   (PolKitCaller *caller);
void                polkit_caller_unref                 (PolKitCaller *caller);
polkit_bool_t       polkit_caller_set_dbus_name         (PolKitCaller *caller,
                                                         const char *dbus_name);
polkit_bool_t       polkit_caller_set_uid               (PolKitCaller *caller,
                                                         uid_t uid);
polkit_bool_t       polkit_caller_set_pid               (PolKitCaller *caller,
                                                         pid_t pid);
polkit_bool_t       polkit_caller_set_selinux_context   (PolKitCaller *caller,
                                                         const char *selinux_context);
polkit_bool_t       polkit_caller_set_ck_session        (PolKitCaller *caller,
                                                         PolKitSession *session);
polkit_bool_t       polkit_caller_get_dbus_name         (PolKitCaller *caller,
                                                         char **out_dbus_name);
polkit_bool_t       polkit_caller_get_uid               (PolKitCaller *caller,
                                                         uid_t *out_uid);
polkit_bool_t       polkit_caller_get_pid               (PolKitCaller *caller,
                                                         pid_t *out_pid);
polkit_bool_t       polkit_caller_get_selinux_context   (PolKitCaller *caller,
                                                         char **out_selinux_context);
polkit_bool_t       polkit_caller_get_ck_session        (PolKitCaller *caller,
                                                         PolKitSession **out_session);
void                polkit_caller_debug                 (PolKitCaller *caller);
polkit_bool_t       polkit_caller_validate              (PolKitCaller *caller);

Description

This class is used to represent a caller in another process connected to the system message bus.

Details

struct PolKitCaller

struct PolKitCaller;

Objects of this class are used to record information about a caller on the system bus.


polkit_caller_new ()

PolKitCaller*       polkit_caller_new                   (void);

Creates a new PolKitCaller object.

Returns : the new object

polkit_caller_ref ()

PolKitCaller*       polkit_caller_ref                   (PolKitCaller *caller);

Increase reference count.

caller : The caller object
Returns : the object

polkit_caller_unref ()

void                polkit_caller_unref                 (PolKitCaller *caller);

Decreases the reference count of the object. If it becomes zero, the object is freed. Before freeing, reference counts on embedded objects are decresed by one.

caller : The caller object

polkit_caller_set_dbus_name ()

polkit_bool_t       polkit_caller_set_dbus_name         (PolKitCaller *caller,
                                                         const char *dbus_name);

Set the callers unique system bus connection name.

caller : The caller object
dbus_name : unique system bus connection name
Returns : TRUE only if the value validated and was set

polkit_caller_set_uid ()

polkit_bool_t       polkit_caller_set_uid               (PolKitCaller *caller,
                                                         uid_t uid);

Set the callers UNIX user id.

caller : The caller object
uid : UNIX user id
Returns : TRUE only if the value validated and was set

polkit_caller_set_pid ()

polkit_bool_t       polkit_caller_set_pid               (PolKitCaller *caller,
                                                         pid_t pid);

Set the callers UNIX process id.

caller : The caller object
pid : UNIX process id
Returns : TRUE only if the value validated and was set

polkit_caller_set_selinux_context ()

polkit_bool_t       polkit_caller_set_selinux_context   (PolKitCaller *caller,
                                                         const char *selinux_context);

Set the callers SELinux security context.

caller : The caller object
selinux_context : SELinux security context
Returns : TRUE only if the value validated and was set

polkit_caller_set_ck_session ()

polkit_bool_t       polkit_caller_set_ck_session        (PolKitCaller *caller,
                                                         PolKitSession *session);

Set the callers session. The reference count on the given object will be increased by one. If an existing session object was set already, the reference count on that one will be decreased by one.

caller : The caller object
session : a session object
Returns : TRUE only if the value validated and was set

polkit_caller_get_dbus_name ()

polkit_bool_t       polkit_caller_get_dbus_name         (PolKitCaller *caller,
                                                         char **out_dbus_name);

Get the callers unique system bus connection name.

caller : The caller object
out_dbus_name : Returns the unique system bus connection name. The caller shall not free this string.
Returns : TRUE iff the value is returned

polkit_caller_get_uid ()

polkit_bool_t       polkit_caller_get_uid               (PolKitCaller *caller,
                                                         uid_t *out_uid);

Get the callers UNIX user id.

caller : The caller object
out_uid : Returns the UNIX user id
Returns : TRUE iff the value is returned

polkit_caller_get_pid ()

polkit_bool_t       polkit_caller_get_pid               (PolKitCaller *caller,
                                                         pid_t *out_pid);

Get the callers UNIX process id.

caller : The caller object
out_pid : Returns the UNIX process id
Returns : TRUE iff the value is returned

polkit_caller_get_selinux_context ()

polkit_bool_t       polkit_caller_get_selinux_context   (PolKitCaller *caller,
                                                         char **out_selinux_context);

Get the callers SELinux security context. Note that this may be NULL if SELinux is not available on the system.

caller : The caller object
out_selinux_context : Returns the SELinux security context. The caller shall not free this string.
Returns : TRUE iff the value is returned

polkit_caller_get_ck_session ()

polkit_bool_t       polkit_caller_get_ck_session        (PolKitCaller *caller,
                                                         PolKitSession **out_session);

Get the callers session. Note that this may be NULL if the caller is not in any session.

caller : The caller object
out_session : Returns the session object. Caller shall not unref it.
Returns : TRUE iff the value is returned

polkit_caller_debug ()

void                polkit_caller_debug                 (PolKitCaller *caller);

Print debug details

caller : the object

polkit_caller_validate ()

polkit_bool_t       polkit_caller_validate              (PolKitCaller *caller);

Validate the object

caller : the object
Returns : TRUE iff the object is valid.