X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=man%2Fsd_bus_creds_get_pid.xml;h=29cb9bd32fed76b7ecbae14c0c8b24b433572357;hb=d04b238170998e0cbcc86db0f8ae66c3ee4a14d6;hp=22eb6e5462211e4a196f20aca17c58b40f6c03f0;hpb=81c7dd897c6af68e66b58e97abce676641edc197;p=elogind.git diff --git a/man/sd_bus_creds_get_pid.xml b/man/sd_bus_creds_get_pid.xml index 22eb6e546..29cb9bd32 100644 --- a/man/sd_bus_creds_get_pid.xml +++ b/man/sd_bus_creds_get_pid.xml @@ -1,27 +1,27 @@ - + - + sd_bus_creds_get_pid @@ -44,18 +44,26 @@ along with systemd; If not, see . sd_bus_creds_get_pid - sd_bus_creds_get_pid_starttime + sd_bus_creds_get_ppid sd_bus_creds_get_tid sd_bus_creds_get_uid + sd_bus_creds_get_euid + sd_bus_creds_get_suid + sd_bus_creds_get_fsuid sd_bus_creds_get_gid + sd_bus_creds_get_egid + sd_bus_creds_get_sgid + sd_bus_creds_get_fsgid + sd_bus_creds_get_supplementary_gids sd_bus_creds_get_comm sd_bus_creds_get_tid_comm sd_bus_creds_get_exe sd_bus_creds_get_cmdline sd_bus_creds_get_cgroup sd_bus_creds_get_unit - sd_bus_creds_get_user_unit sd_bus_creds_get_slice + sd_bus_creds_get_user_unit + sd_bus_creds_get_user_slice sd_bus_creds_get_session sd_bus_creds_get_owner_uid sd_bus_creds_has_effective_cap @@ -65,9 +73,10 @@ along with systemd; If not, see . sd_bus_creds_get_selinux_context sd_bus_creds_get_audit_session_id sd_bus_creds_get_audit_login_uid + sd_bus_creds_get_tty sd_bus_creds_get_unique_name sd_bus_creds_get_well_known_names - sd_bus_creds_get_connection_name + sd_bus_creds_get_description Retrieve fields from a credentials object @@ -83,9 +92,9 @@ along with systemd; If not, see . - int sd_bus_creds_get_pid_starttime + int sd_bus_creds_get_ppid sd_bus_creds *c - uint64_t *usec + pid_t *ppid @@ -95,7 +104,25 @@ along with systemd; If not, see . - int sd_bus_creds_get_pid + int sd_bus_creds_get_uid + sd_bus_creds *c + uid_t *uid + + + + int sd_bus_creds_get_euid + sd_bus_creds *c + uid_t *uid + + + + int sd_bus_creds_get_suid + sd_bus_creds *c + uid_t *uid + + + + int sd_bus_creds_get_fsuid sd_bus_creds *c uid_t *uid @@ -106,6 +133,30 @@ along with systemd; If not, see . gid_t *gid + + int sd_bus_creds_get_egid + sd_bus_creds *c + gid_t *gid + + + + int sd_bus_creds_get_sgid + sd_bus_creds *c + gid_t *gid + + + + int sd_bus_creds_get_fsgid + sd_bus_creds *c + gid_t *gid + + + + int sd_bus_creds_get_supplementary_gids + sd_bus_creds *c + const gid_t **gids + + int sd_bus_creds_get_comm sd_bus_creds *c @@ -142,6 +193,12 @@ along with systemd; If not, see . const char **unit + + int sd_bus_creds_get_slice + sd_bus_creds *c + const char **slice + + int sd_bus_creds_get_user_unit sd_bus_creds *c @@ -149,7 +206,7 @@ along with systemd; If not, see . - int sd_bus_creds_get_slice + int sd_bus_creds_get_user_slice sd_bus_creds *c const char **slice @@ -208,6 +265,12 @@ along with systemd; If not, see . uid_t *loginuid + + int sd_bus_creds_get_tty + sd_bus_creds *c + const char **tty + + int sd_bus_creds_get_unique_name sd_bus_creds *c @@ -221,7 +284,7 @@ along with systemd; If not, see . - int sd_bus_creds_get_connection_name + int sd_bus_creds_get_description sd_bus_creds *c const char **name @@ -232,31 +295,52 @@ along with systemd; If not, see . Description - These functions return information from an - sd_bus_creds object. It may be created with + These functions return credential information from an + sd_bus_creds object. Credential objects may + be created with sd_bus_creds_new_from_pid3, - in which case it will describe the specified process, or it may be - created by + in which case they describe the credentials of the process + identified by the specified PID, with + sd_bus_get_name_creds3, + in which case they describe the credentials of a bus peer + identified by the specified bus name, with sd_bus_get_owner_creds3, - in which case it will describe the process at the other endpoint - of a connection. - - - sd_bus_creds_get_pid() will retrieve the - PID (process identifier). - - sd_bus_creds_get_pid_starttime() will - retrieve the time since the start of the epoch in microseconds - since the process was started. + in which case they describe the credentials of the creator of a + bus, or with + sd_bus_message_get_creds3, + in which case they describe the credentials of the sender of the + message. + + Not all credential fields are part of every + sd_bus_creds object. Use + sd_bus_creds_get_mask3 + to determine the mask of fields available. + + sd_bus_creds_get_pid() will retrieve + the PID (process identifier). Similarly, + sd_bus_creds_get_ppid() will retrieve the + parent PID. Note that PID 1 has no parent process, in which case + -ENXIO is returned. sd_bus_creds_get_tid() will retrieve the TID (thread identifier). - sd_bus_creds_get_uid() will retrieve the - numeric UID (user identifier). + sd_bus_creds_get_uid() will retrieve + the numeric UID (user identifier). Similarly, + sd_bus_creds_get_euid() returns the effective + UID, sd_bus_creds_get_suid() the saved UID + and sd_bus_creds_get_fsuid() the file system + UID. sd_bus_creds_get_gid() will retrieve the - numeric GID (group identifier). + numeric GID (group identifier). Similarly, + sd_bus_creds_get_egid() returns the effective + GID, sd_bus_creds_get_sgid() the saved GID + and sd_bus_creds_get_fsgid() the file system + GID. + + sd_bus_creds_get_supplementary_gids() + will retrieve the supplementary GIDs list. sd_bus_creds_get_comm() will retrieve the comm field (truncated name of the executable, as stored in @@ -268,62 +352,65 @@ along with systemd; If not, see . /proc/pid/task/tid/comm). - sd_bus_creds_get_exe() will retrieve the - path to the program (as stored in the + sd_bus_creds_get_exe() will retrieve + the path to the program executable (as stored in the /proc/pid/exe - link, but with (deleted) suffix removed). - + link, but with the (deleted) suffix removed). Note + that kernel threads do not have an executable path, in which case + -ENXIO is returned. - sd_bus_creds_get_cmdline() will retrieve - an array of command line arguments (as stored in - /proc/pid/cmdline). - + sd_bus_creds_get_cmdline() will + retrieve an array of command line arguments (as stored in + /proc/pid/cmdline). Note + that kernel threads do not have a command line, in which case + -ENXIO is returned. sd_bus_creds_get_cgroup() will retrieve - the cgroup path. See cgroups.txt. - sd_bus_creds_get_unit() will retrieve the - systemd unit name (in the system instance of systemd) that the - process is part of. See - systemd.unit5. + sd_bus_creds_get_unit() will retrieve + the systemd unit name (in the system instance of systemd) that the + process is a part of. See + systemd.unit5. For + processes that are not part of a unit, returns -ENXIO. sd_bus_creds_get_user_unit() will retrieve the systemd unit name (in the user instance of systemd) - that the process is part of. See - systemd.unit5. + that the process is a part of. See + systemd.unit5. For + processes that are not part of a user unit, returns -ENXIO. sd_bus_creds_get_slice() will retrieve the systemd slice (a unit in the system instance of systemd) that - the process is part of. See - systemd.slice5. + the process is a part of. See + systemd.slice5. Similarly, + sd_bus_creds_get_user_slice() retrieves the + systemd slice of the process, in the user instance of systemd. - sd_bus_creds_get_session() will retrieve - the logind session that the process is part of. See - systemd-logind.service8. + sd_bus_creds_get_session() will + retrieve the identifier of the login session that the process is + a part of. See + systemd-logind.service8. For + processes that are not part of a session, returns -ENXIO. - sd_bus_creds_get_owner_uid() will retrieve - the numeric UID (user identifier) of the user who owns the slice - that the process is part of. See - systemd.slice5 - . + sd_bus_creds_get_owner_uid() will + retrieve the numeric UID (user identifier) of the user who owns + the login session that the process is a part of. See + systemd-logind.service8. + For processes that are not part of a session, returns -ENXIO. - sd_bus_creds_has_effective_cap() will - check whether the capability specified by - capability was set in the effective - capabilities mask. A positive return value means that is was - set, zero means that it was not set, and a negative return - value signifies an error. See - capabilities7 - and Capabilities= and - CapabilityBoundingSet= settings in + sd_bus_creds_has_effective_cap() will check whether the capability specified by + capability was set in the effective capabilities mask. A positive return value means that it + was set, zero means that it was not set, and a negative return value indicates an error. See capabilities7 and the + AmbientCapabilities= and CapabilityBoundingSet= settings in systemd.exec5. @@ -342,12 +429,18 @@ along with systemd; If not, see . sd_bus_creds_get_selinux_context() will retrieve the SELinux security context (label) of the process. - sd_bus_creds_get_audit_session_id() will - retrieve the audit session identifier of the process. + sd_bus_creds_get_audit_session_id() + will retrieve the audit session identifier of the process. Returns + -ENXIO for processes that are not part of an audit session. sd_bus_creds_get_audit_login_uid() will retrieve the audit user login identifier (the identifier of the - user who is "responsible" for the session). + user who is "responsible" for the session). Returns -ENXIO for + processes that are not part of an audit session. + + sd_bus_creds_get_tty() will retrieve + the controlling TTY, without the prefixing "/dev/". Returns -ENXIO + for processes that have no controlling TTY. sd_bus_creds_get_unique_name() will retrieve the D-Bus unique name. See . url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus">The D-Bus specification. - sd_bus_creds_get_connection_name() will + sd_bus_creds_get_description() will retrieve a descriptive name of the bus connection of the peer. This name is useful to discern multiple bus connections by the same peer, and may be altered by the peer with the - sd_bus_set_name()3 + sd_bus_set_description3 call. All functions that take a const @@ -373,8 +466,8 @@ along with systemd; If not, see . modified by the caller. All functions that take a char*** - parameter will store the answer there as an address of a an array - of strings. Each invidividual string is NUL-terminated, and the + parameter will store the answer there as an address of an array + of strings. Each individual string is NUL-terminated, and the array is NULL-terminated as a whole. It will be valid as long as c remains valid, and should not be freed or modified by the caller. @@ -397,33 +490,37 @@ along with systemd; If not, see . -ENODATA - Given field is not available in - c. + The given field is not available in the + credentials object c. - -ENOENT + -ENXIO - Given field is not specified for the sender. - This will be returned by sd_bus_get_unit(), - sd_bus_get_user_unit(), + The given field is not specified for the described + process or peer. This will be returned by + sd_bus_get_unit(), sd_bus_get_slice(), + sd_bus_get_user_unit(), + sd_bus_get_user_slice(), sd_bus_get_session(), and - sd_bus_get_name_creds_uid() if the sender is not - part of a systemd system unit, systemd user unit, systemd - slice, logind session, or a systemd user session. + sd_bus_get_owner_uid() if the process is + not part of a systemd system unit, systemd user unit, systemd + slice, or logind session. It will also be returned by + sd_bus_creds_get_exe() and + sd_bus_creds_get_cmdline() for kernel + threads (since these are not started from an executable binary, + nor have a command line), and by + sd_bus_creds_get_audit_session_id() and + sd_bus_creds_get_audit_login_uid() when + the process is not part of an audit session, and + sd_bus_creds_get_tty() if the process has + no controlling TTY. + - - -ENXIO - - An error occurred in parsing cgroup paths. - libsystemd might be out of sync with - the running systemd version. - - -EINVAL @@ -442,10 +539,11 @@ along with systemd; If not, see . Notes - sd_bus_open_user() and other functions - described here are available as a shared library, which can be - compiled and linked to with the - libsystemd pkg-config1 + sd_bus_creds_get_pid() and the other + functions described here are available as a shared library, which + can be compiled and linked to with the + libelogind pkg-config1 file. @@ -455,12 +553,13 @@ along with systemd; If not, see . systemd1, sd-bus3, - fork2, - execve2, + sd_bus_creds_new_from_pid2, + fork2, + execve2, credentials7, free3, proc5, - systemd.journald-fields7 + systemd.journal-fields7