From 4cf8496d0a5e85ec7610d166c5d35df3e6d02d1a Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sat, 4 Jan 2014 19:28:52 -0500 Subject: man: document some more bus functions --- man/sd_bus_creds_new_from_pid.xml | 275 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 man/sd_bus_creds_new_from_pid.xml (limited to 'man/sd_bus_creds_new_from_pid.xml') diff --git a/man/sd_bus_creds_new_from_pid.xml b/man/sd_bus_creds_new_from_pid.xml new file mode 100644 index 0000000000..302004d5a5 --- /dev/null +++ b/man/sd_bus_creds_new_from_pid.xml @@ -0,0 +1,275 @@ + + + + + + + + + sd_bus_creds_new_from_pid + systemd + + + + A monkey with a typewriter + Zbigniew + Jędrzejewski-Szmek + zbyszek@in.waw.pl + + + + + + sd_bus_creds_new_from_pid + 3 + + + + sd_bus_creds_new_from_pid + sd_bus_creds_get_mask + sd_bus_creds_ref + sd_bus_creds_unref + + Retrieve credentials object for the specified PID + + + + + #include <systemd/sd-bus.h> + + + int sd_bus_creds_new_from_pid + pid_t pid + uint64_t creds_mask + sd_bus_creds** ret + + + + uint64_t sd_bus_creds_get_mask + const sd_bus_creds* c + + + + sd_bus_creds* sd_bus_creds_ref + sd_bus_creds* c + + + + sd_bus_creds* sd_bus_creds_unref + sd_bus_creds* c + + + + + SD_BUS_CREDS_PID, + SD_BUS_CREDS_PID_STARTTIME, + SD_BUS_CREDS_TID, + SD_BUS_CREDS_UID, + SD_BUS_CREDS_GID, + SD_BUS_CREDS_COMM, + SD_BUS_CREDS_TID_COMM, + SD_BUS_CREDS_EXE, + SD_BUS_CREDS_CMDLINE, + SD_BUS_CREDS_CGROUP, + SD_BUS_CREDS_UNIT, + SD_BUS_CREDS_USER_UNIT, + SD_BUS_CREDS_SLICE, + SD_BUS_CREDS_SESSION, + SD_BUS_CREDS_OWNER_UID, + SD_BUS_CREDS_EFFECTIVE_CAPS, + SD_BUS_CREDS_PERMITTED_CAPS, + SD_BUS_CREDS_INHERITABLE_CAPS, + SD_BUS_CREDS_BOUNDING_CAPS, + SD_BUS_CREDS_SELINUX_CONTEXT, + SD_BUS_CREDS_AUDIT_SESSION_ID, + SD_BUS_CREDS_AUDIT_LOGIN_UID, + SD_BUS_CREDS_UNIQUE_NAME, + SD_BUS_CREDS_WELL_KNOWN_NAMES, + _SD_BUS_CREDS_ALL + + + + + Description + + sd_bus_creds_new_from_pid() creates a new + credentials object and fills it with information about the process + pid. This pointer to this object will + be stored in ret pointer. + + The information that will be stored is determined by + creds_mask. It may contain a subset of ORed + constants SD_BUS_CREDS_PID, + SD_BUS_CREDS_PID_STARTTIME, + SD_BUS_CREDS_TID, + SD_BUS_CREDS_UID, + SD_BUS_CREDS_GID, + SD_BUS_CREDS_COMM, + SD_BUS_CREDS_TID_COMM, + SD_BUS_CREDS_EXE, + SD_BUS_CREDS_CMDLINE, + SD_BUS_CREDS_CGROUP, + SD_BUS_CREDS_UNIT, + SD_BUS_CREDS_USER_UNIT, + SD_BUS_CREDS_SLICE, + SD_BUS_CREDS_SESSION, + SD_BUS_CREDS_OWNER_UID, + SD_BUS_CREDS_EFFECTIVE_CAPS, + SD_BUS_CREDS_PERMITTED_CAPS, + SD_BUS_CREDS_INHERITABLE_CAPS, + SD_BUS_CREDS_BOUNDING_CAPS, + SD_BUS_CREDS_SELINUX_CONTEXT, + SD_BUS_CREDS_AUDIT_SESSION_ID, + SD_BUS_CREDS_AUDIT_LOGIN_UID, + SD_BUS_CREDS_UNIQUE_NAME, + SD_BUS_CREDS_WELL_KNOWN_NAMES, + or _SD_BUS_CREDS_ALL to indicate + all known fields. + + Fields can be retrieved from the credentials object using + sd_bus_creds_get_pid3 + and other functions which correspond directly to the constants + listed above. + + A mask of fields which were actually sucessfully set + (acquired from /proc, etc.) can be retrieved + with sd_bus_creds_get_mask(). If the + credentials object was created with + sd_bus_creds_new_from_pid(), this will be a + subset of fields requested in creds_mask. + + + sd_bus_creds_ref creates a new + reference to the credentials object c. This + object will not be destroyed until + sd_bus_creds_unref has been called as many + times plus once more. Once the reference count has dropped to zero, + c cannot be used anymore, so futher + calls to sd_bus_creds_ref(c) or + sd_bus_creds_unref(c) are illegal. + + sd_bus_creds_unref destroys a reference + to c. + + + + Return Value + + On success, sd_bus_creds_new_from_pid() + returns 0 or a positive integer. On failure, it returns a negative + errno-style error code. + + sd_bus_creds_get_mask() returns the + mask of successfully acquired fields. + + sd_bus_creds_ref always returns the + argument. + + sd_bus_creds_unref always returns + NULL. + + + + Reference ownership + + Function sd_bus_creds_new_from_pid() + creates a new object and the caller owns the sole reference. When + not needed anymore, this reference should be destroyed with + sd_bus_creds_unref3. + + + + + Errors + + Returned errors may indicate the following problems: + + + + + -ESRCH + + Specified pid could not + be found. + + + + -EINVAL + + Specified parameter is invalid + (NULL in case of output + parameters). + + + + -ENOMEM + + Memory allocation failed. + + + + + + Notes + + sd_bus_creds_new_from_pid() is + available as a shared library, which can be compiled and linked to + with the + libsystemd-bus pkg-config1 + file. + + + + See Also + + + systemd1, + sd-bus3, + sd_bus_creds_ref3, + sd_bus_creds_unref3, + sd_bus_creds_get_pid3, + sd_bus_creds_get_pid_starttime3, + sd_bus_creds_get_tid3, + sd_bus_creds_get_uid3, + sd_bus_creds_get_gid3, + sd_bus_creds_get_comm3, + sd_bus_creds_get_tid_comm3, + sd_bus_creds_get_exe3, + sd_bus_creds_get_cmdline3, + sd_bus_creds_get_cgroup3, + sd_bus_creds_get_unit3, + sd_bus_creds_get_user_unit3, + sd_bus_creds_get_slice3, + sd_bus_creds_get_session3, + sd_bus_creds_get_owner_uid3, + sd_bus_creds_has_effective_cap3, + sd_bus_creds_has_permitted_cap3, + sd_bus_creds_has_inheritable_cap3, + sd_bus_creds_has_bounding_cap3, + sd_bus_creds_get_selinux_context3, + sd_bus_creds_get_audit_session_id3, + sd_bus_creds_get_audit_login_uid3, + sd_bus_creds_get_unique_name3, + sd_bus_creds_get_well_known_names3 + + + + -- cgit v1.2.3-54-g00ecf