2014-11-22 03:44:48 +08:00
|
|
|
|
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
|
|
|
|
|
|
|
|
|
<!--
|
2015-03-14 10:26:47 +08:00
|
|
|
|
This file is part of systemd.
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2015-03-14 10:26:47 +08:00
|
|
|
|
Copyright 2014 Zbigniew Jędrzejewski-Szmek
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2015-03-14 10:26:47 +08:00
|
|
|
|
systemd is free software; you can redistribute it and/or modify it
|
|
|
|
|
under the terms of the GNU Lesser General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
|
(at your option) any later version.
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2015-03-14 10:26:47 +08:00
|
|
|
|
systemd is distributed in the hope that it will be useful, but
|
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
Lesser General Public License for more details.
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2015-03-14 10:26:47 +08:00
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
2014-01-04 13:08:50 +08:00
|
|
|
|
-->
|
|
|
|
|
|
2014-02-20 05:04:30 +08:00
|
|
|
|
<refentry id="sd_bus_creds_get_pid" conditional="ENABLE_KDBUS">
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
|
|
|
|
<refentryinfo>
|
|
|
|
|
<title>sd_bus_creds_get_pid</title>
|
|
|
|
|
<productname>systemd</productname>
|
|
|
|
|
|
|
|
|
|
<authorgroup>
|
|
|
|
|
<author>
|
|
|
|
|
<contrib>A monkey with a typewriter</contrib>
|
|
|
|
|
<firstname>Zbigniew</firstname>
|
|
|
|
|
<surname>Jędrzejewski-Szmek</surname>
|
|
|
|
|
<email>zbyszek@in.waw.pl</email>
|
|
|
|
|
</author>
|
|
|
|
|
</authorgroup>
|
|
|
|
|
</refentryinfo>
|
|
|
|
|
|
|
|
|
|
<refmeta>
|
|
|
|
|
<refentrytitle>sd_bus_creds_get_pid</refentrytitle>
|
|
|
|
|
<manvolnum>3</manvolnum>
|
|
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
|
|
<refnamediv>
|
|
|
|
|
<refname>sd_bus_creds_get_pid</refname>
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<refname>sd_bus_creds_get_ppid</refname>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<refname>sd_bus_creds_get_tid</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_uid</refname>
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<refname>sd_bus_creds_get_euid</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_suid</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_fsuid</refname>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<refname>sd_bus_creds_get_gid</refname>
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<refname>sd_bus_creds_get_egid</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_sgid</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_fsgid</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_supplementary_gids</refname>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<refname>sd_bus_creds_get_comm</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_tid_comm</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_exe</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_cmdline</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_cgroup</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_unit</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_user_unit</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_slice</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_session</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_owner_uid</refname>
|
|
|
|
|
<refname>sd_bus_creds_has_effective_cap</refname>
|
|
|
|
|
<refname>sd_bus_creds_has_permitted_cap</refname>
|
|
|
|
|
<refname>sd_bus_creds_has_inheritable_cap</refname>
|
|
|
|
|
<refname>sd_bus_creds_has_bounding_cap</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_selinux_context</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_audit_session_id</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_audit_login_uid</refname>
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<refname>sd_bus_creds_get_tty</refname>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<refname>sd_bus_creds_get_unique_name</refname>
|
|
|
|
|
<refname>sd_bus_creds_get_well_known_names</refname>
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<refname>sd_bus_creds_get_description</refname>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
|
|
|
|
<refpurpose>Retrieve fields from a credentials object</refpurpose>
|
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
|
<funcsynopsis>
|
|
|
|
|
<funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_pid</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>pid_t *<parameter>pid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_ppid</function></funcdef>
|
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
|
|
|
|
<paramdef>pid_t *<parameter>ppid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_tid</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>pid_t *<parameter>tid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_uid</function></funcdef>
|
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
|
|
|
|
<paramdef>uid_t *<parameter>uid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_euid</function></funcdef>
|
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
|
|
|
|
<paramdef>uid_t *<parameter>uid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_suid</function></funcdef>
|
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
|
|
|
|
<paramdef>uid_t *<parameter>uid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_fsuid</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>uid_t *<parameter>uid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_gid</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>gid_t *<parameter>gid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_egid</function></funcdef>
|
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
|
|
|
|
<paramdef>gid_t *<parameter>gid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_sgid</function></funcdef>
|
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
|
|
|
|
<paramdef>gid_t *<parameter>gid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_fsgid</function></funcdef>
|
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
|
|
|
|
<paramdef>gid_t *<parameter>gid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_supplementary_gids</function></funcdef>
|
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
|
|
|
|
<paramdef>const gid_t **<parameter>gids</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_comm</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>const char **<parameter>comm</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_tid_comm</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>const char **<parameter>comm</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_exe</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>const char **<parameter>exe</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_cmdline</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>char ***<parameter>cmdline</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_cgroup</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>const char **<parameter>cgroup</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_unit</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>const char **<parameter>unit</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_user_unit</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>const char **<parameter>unit</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_slice</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>const char **<parameter>slice</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_session</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>const char **<parameter>slice</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_owner_uid</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>uid_t *<parameter>uid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_has_effective_cap</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>int <parameter>capability</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_has_permitted_cap</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>int <parameter>capability</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_has_inheritable_cap</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>int <parameter>capability</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_has_bounding_cap</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>int <parameter>capability</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_selinux_context</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>const char **<parameter>context</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_audit_session_id</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>uint32_t *<parameter>sessionid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_audit_login_uid</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>uid_t *<parameter>loginuid</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_tty</function></funcdef>
|
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
|
|
|
|
<paramdef>const char **<parameter>tty</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_unique_name</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>const char **<parameter>name</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
|
|
|
|
<funcprototype>
|
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_well_known_names</function></funcdef>
|
2014-02-16 20:55:27 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<paramdef>char ***<parameter>name</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
2014-10-18 22:20:36 +08:00
|
|
|
|
<funcprototype>
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<funcdef>int <function>sd_bus_creds_get_description</function></funcdef>
|
2014-10-18 22:20:36 +08:00
|
|
|
|
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
|
|
|
|
|
<paramdef>const char **<parameter>name</parameter></paramdef>
|
|
|
|
|
</funcprototype>
|
|
|
|
|
|
2014-01-04 13:08:50 +08:00
|
|
|
|
</funcsynopsis>
|
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
|
<title>Description</title>
|
|
|
|
|
|
2014-02-17 10:37:18 +08:00
|
|
|
|
<para>These functions return information from an
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<parameter>sd_bus_creds</parameter> credential object. Credential
|
|
|
|
|
objects may be created with
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<citerefentry><refentrytitle>sd_bus_creds_new_from_pid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
|
2015-04-30 03:44:55 +08:00
|
|
|
|
in which case they describe the credentials of the process
|
|
|
|
|
identified by the specified PID, with
|
|
|
|
|
<citerefentry><refentrytitle>sd_bus_get_name_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
|
|
|
|
|
in which case they describe the credentials of a bus peer
|
|
|
|
|
identified by the specified bus name, or with
|
2014-10-23 01:17:24 +08:00
|
|
|
|
<citerefentry><refentrytitle>sd_bus_get_owner_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
|
2015-04-30 03:44:55 +08:00
|
|
|
|
in which case they describe the credentials of the creator of a
|
|
|
|
|
bus.</para>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_pid()</function> will retrieve
|
|
|
|
|
the PID (process identifier). Similar,
|
|
|
|
|
<function>sd_bus_creds_get_ppid()</function> will retrieve the
|
|
|
|
|
parent PID. Note that PID 1 has no parent process, in which case
|
|
|
|
|
-ENXIO is returned.</para>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_tid()</function> will retrieve the
|
2014-01-04 13:08:50 +08:00
|
|
|
|
TID (thread identifier).</para>
|
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_uid()</function> will retrieve
|
|
|
|
|
the numeric UID (user identifier). Similar,
|
|
|
|
|
<function>sd_bus_creds_get_euid()</function> returns the effective
|
|
|
|
|
UID, <function>sd_bus_creds_get_suid()</function> the saved UID
|
|
|
|
|
and <function>sd_bus_creds_get_fsuid()</function> the file system
|
|
|
|
|
UID.</para>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_gid()</function> will retrieve the
|
2015-04-30 03:44:55 +08:00
|
|
|
|
numeric GID (group identifier). Similar,
|
|
|
|
|
<function>sd_bus_creds_get_egid()</function> returns the effective
|
|
|
|
|
GID, <function>sd_bus_creds_get_sgid()</function> the saved GID
|
|
|
|
|
and <function>sd_bus_creds_get_fsgid()</function> the file system
|
|
|
|
|
GID.</para>
|
|
|
|
|
|
|
|
|
|
<para><function>sd_bus_creds_get_supplementary_gids()</function>
|
|
|
|
|
will retrieve the supplementary GIDs list.</para>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_comm()</function> will retrieve the
|
2014-02-17 09:49:45 +08:00
|
|
|
|
comm field (truncated name of the executable, as stored in
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<filename>/proc/<replaceable>pid</replaceable>/comm</filename>).
|
|
|
|
|
</para>
|
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_tid_comm()</function> will retrieve
|
2014-01-04 13:08:50 +08:00
|
|
|
|
the comm field of the thread (as stored in
|
|
|
|
|
<filename>/proc/<replaceable>pid</replaceable>/task/<replaceable>tid</replaceable>/comm</filename>).
|
|
|
|
|
</para>
|
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_exe()</function> will retrieve
|
|
|
|
|
the path to the program executable (as stored in the
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<filename>/proc/<replaceable>pid</replaceable>/exe</filename>
|
2015-04-30 03:44:55 +08:00
|
|
|
|
link, but with <literal> (deleted)</literal> suffix removed). Note
|
|
|
|
|
that kernel threads do not have an executable path, in which case
|
|
|
|
|
-ENXIO is returned.</para>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_cmdline()</function> will
|
|
|
|
|
retrieve an array of command line arguments (as stored in
|
|
|
|
|
<filename>/proc/<replaceable>pid</replaceable>/cmdline</filename>). Note
|
|
|
|
|
that kernel threads do not have a command line, in which case
|
|
|
|
|
-ENXIO is returned.</para>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_cgroup()</function> will retrieve
|
2014-01-04 13:08:50 +08:00
|
|
|
|
the cgroup path. See <ulink
|
|
|
|
|
url="https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt">cgroups.txt</ulink>.
|
|
|
|
|
</para>
|
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_unit()</function> will retrieve
|
|
|
|
|
the systemd unit name (in the system instance of systemd) that the
|
2014-01-04 13:08:50 +08:00
|
|
|
|
process is part of. See
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
|
|
|
|
|
processes that are not part of a unit returns -ENXIO.
|
2014-01-04 13:08:50 +08:00
|
|
|
|
</para>
|
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_user_unit()</function> will
|
2014-01-04 13:08:50 +08:00
|
|
|
|
retrieve the systemd unit name (in the user instance of systemd)
|
|
|
|
|
that the process is part of. See
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
|
|
|
|
|
processes that are not part of a user unit returns -ENXIO.
|
2014-01-04 13:08:50 +08:00
|
|
|
|
</para>
|
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_slice()</function> will retrieve
|
2014-01-04 13:08:50 +08:00
|
|
|
|
the systemd slice (a unit in the system instance of systemd) that
|
|
|
|
|
the process is part of. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
|
|
|
|
|
</para>
|
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_session()</function> will
|
|
|
|
|
retrieve the logind session that the process is part of. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. For
|
|
|
|
|
processes that are not part of a session returns -ENXIO.
|
2014-01-04 13:08:50 +08:00
|
|
|
|
</para>
|
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_owner_uid()</function> will
|
|
|
|
|
retrieve the numeric UID (user identifier) of the user who owns
|
|
|
|
|
the session that the process is part of. See
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
2015-04-30 03:44:55 +08:00
|
|
|
|
For processes that are not part of a session returns -ENXIO.
|
2014-01-04 13:08:50 +08:00
|
|
|
|
</para>
|
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_has_effective_cap()</function> will
|
2014-01-08 11:27:43 +08:00
|
|
|
|
check whether the capability specified by
|
|
|
|
|
<parameter>capability</parameter> was set in the effective
|
2014-02-17 10:37:18 +08:00
|
|
|
|
capabilities mask. A positive return value means that is was
|
2014-01-08 11:27:43 +08:00
|
|
|
|
set, zero means that it was not set, and a negative return
|
2014-01-04 13:08:50 +08:00
|
|
|
|
value signifies an error. See
|
man: add a mapping for external manpages
It is annoying when we have dead links on fd.o.
Add project='man-pages|die-net|archlinux' to <citerefentry>-ies.
In generated html, add external links to
http://man7.org/linux/man-pages/man, http://linux.die.net/man/,
https://www.archlinux.org/.
By default, pages in sections 2 and 4 go to man7, since Michael
Kerrisk is the autorative source on kernel related stuff.
The rest of links goes to linux.die.net, because they have the
manpages.
Except for the pacman stuff, since it seems to be only available from
archlinux.org.
Poor gummiboot gets no link, because gummitboot(8) ain't to be found
on the net. According to common wisdom, that would mean that it does
not exist. But I have seen Kay using it, so I know it does, and
deserves to be found. Can somebody be nice and put it up somewhere?
2014-07-08 06:25:54 +08:00
|
|
|
|
<citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
and <varname>Capabilities=</varname> and
|
|
|
|
|
<varname>CapabilityBoundingSet=</varname> settings in
|
|
|
|
|
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
|
|
|
|
|
</para>
|
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_has_permitted_cap()</function> is
|
|
|
|
|
similar to <function>sd_bus_creds_has_effective_cap()</function>,
|
2014-01-04 13:08:50 +08:00
|
|
|
|
but will check the permitted capabilities mask.</para>
|
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_has_inheritable_cap()</function> is
|
|
|
|
|
similar to <function>sd_bus_creds_has_effective_cap()</function>,
|
2014-01-04 13:08:50 +08:00
|
|
|
|
but will check the inheritable capabilities mask.</para>
|
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_has_bounding_cap()</function> is
|
|
|
|
|
similar to <function>sd_bus_creds_has_effective_cap()</function>,
|
2014-01-04 13:08:50 +08:00
|
|
|
|
but will check the bounding capabilities mask.</para>
|
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_selinux_context()</function> will
|
2014-02-10 19:32:03 +08:00
|
|
|
|
retrieve the SELinux security context (label) of the process.</para>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_audit_session_id()</function>
|
|
|
|
|
will retrieve the audit session identifier of the process. Returns
|
|
|
|
|
-ENXIO for processes that are not part of an audit session.</para>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_audit_login_uid()</function> will
|
2014-01-04 13:08:50 +08:00
|
|
|
|
retrieve the audit user login identifier (the identifier of the
|
2015-04-30 03:44:55 +08:00
|
|
|
|
user who is "responsible" for the session). Returns -ENXIO for
|
|
|
|
|
processes that are not part of an audit session.</para>
|
|
|
|
|
|
|
|
|
|
<para><function>sd_bus_creds_get_tty()</function> will retrieve
|
|
|
|
|
the controlling TTY. Returns -ENXIO for processes that have no
|
|
|
|
|
controlling TTY.</para>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_unique_name()</function> will
|
2014-01-04 13:08:50 +08:00
|
|
|
|
retrieve the D-Bus unique name. See <ulink
|
|
|
|
|
url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus">The
|
|
|
|
|
D-Bus specification</ulink>.</para>
|
|
|
|
|
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_well_known_names()</function> will
|
2014-01-04 13:08:50 +08:00
|
|
|
|
retrieve the set of D-Bus well-known names. See <ulink
|
|
|
|
|
url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus">The
|
|
|
|
|
D-Bus specification</ulink>.</para>
|
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<para><function>sd_bus_creds_get_description()</function> will
|
2014-10-18 22:20:36 +08:00
|
|
|
|
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
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<citerefentry><refentrytitle>sd_bus_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>
|
2014-10-18 22:20:36 +08:00
|
|
|
|
call.</para>
|
|
|
|
|
|
2014-01-04 13:08:50 +08:00
|
|
|
|
<para>All functions that take a <parameter>const
|
|
|
|
|
char**</parameter> parameter will store the answer there as an
|
|
|
|
|
address of a NUL-terminated string. It will be valid as long as
|
|
|
|
|
<parameter>c</parameter> remains valid, and should not be freed or
|
|
|
|
|
modified by the caller.</para>
|
|
|
|
|
|
|
|
|
|
<para>All functions that take a <parameter>char***</parameter>
|
|
|
|
|
parameter will store the answer there as an address of a an array
|
|
|
|
|
of strings. Each invidividual string is NUL-terminated, and the
|
|
|
|
|
array is NULL-terminated as a whole. It will be valid as long as
|
|
|
|
|
<parameter>c</parameter> remains valid, and should not be freed or
|
|
|
|
|
modified by the caller.</para>
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
|
<title>Return Value</title>
|
|
|
|
|
|
|
|
|
|
<para>On success, these calls return 0 or a positive integer. On
|
|
|
|
|
failure, these calls return a negative errno-style error code.
|
|
|
|
|
</para>
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
|
<title>Errors</title>
|
|
|
|
|
|
|
|
|
|
<para>Returned errors may indicate the following problems:</para>
|
|
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
|
<varlistentry>
|
2014-09-26 05:27:46 +08:00
|
|
|
|
<term><constant>-ENODATA</constant></term>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<listitem><para>Given field is not available in the
|
|
|
|
|
credentials object <parameter>c</parameter>.</para>
|
2014-02-15 11:07:22 +08:00
|
|
|
|
</listitem>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
|
|
<varlistentry>
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<term><constant>-ENXIO</constant></term>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<listitem><para>Given field is not specified for the described
|
|
|
|
|
process or peer. This will be returned by
|
|
|
|
|
<function>sd_bus_get_unit()</function>,
|
2014-10-18 22:20:24 +08:00
|
|
|
|
<function>sd_bus_get_user_unit()</function>,
|
|
|
|
|
<function>sd_bus_get_slice()</function>,
|
|
|
|
|
<function>sd_bus_get_session()</function>, and
|
2015-04-30 03:44:55 +08:00
|
|
|
|
<function>sd_bus_get_owner_uid()</function> 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
|
|
|
|
|
<function>sd_bus_creds_get_exe()</function> and
|
|
|
|
|
<function>sd_bus_creds_get_cmdline()</function> for kernel
|
|
|
|
|
threads (since these aren't started from an executable binary
|
|
|
|
|
or have a command line),
|
|
|
|
|
<function>sd_bus_creds_get_audit_session_id()</function> and
|
|
|
|
|
<function>sd_bus_creds_get_audit_login_uid()</function> when
|
|
|
|
|
the process is not part of an audit session, and
|
|
|
|
|
<function>sd_bus_creds_get_tty()</function> if the process has
|
|
|
|
|
no controlling TTY.
|
|
|
|
|
</para>
|
2014-02-15 11:07:22 +08:00
|
|
|
|
</listitem>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
|
|
<varlistentry>
|
2014-09-26 05:27:46 +08:00
|
|
|
|
<term><constant>-EINVAL</constant></term>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
|
|
|
|
<listitem><para>Specified pointer parameter is <constant>NULL</constant>.
|
|
|
|
|
</para></listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
|
|
<varlistentry>
|
2014-09-26 05:27:46 +08:00
|
|
|
|
<term><constant>-ENOMEM</constant></term>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
|
|
|
|
|
<listitem><para>Memory allocation failed.</para></listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
</variablelist>
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
|
<title>Notes</title>
|
|
|
|
|
|
|
|
|
|
<para><function>sd_bus_open_user()</function> and other functions
|
|
|
|
|
described here are available as a shared library, which can be
|
|
|
|
|
compiled and linked to with the
|
man: add a mapping for external manpages
It is annoying when we have dead links on fd.o.
Add project='man-pages|die-net|archlinux' to <citerefentry>-ies.
In generated html, add external links to
http://man7.org/linux/man-pages/man, http://linux.die.net/man/,
https://www.archlinux.org/.
By default, pages in sections 2 and 4 go to man7, since Michael
Kerrisk is the autorative source on kernel related stuff.
The rest of links goes to linux.die.net, because they have the
manpages.
Except for the pacman stuff, since it seems to be only available from
archlinux.org.
Poor gummiboot gets no link, because gummitboot(8) ain't to be found
on the net. According to common wisdom, that would mean that it does
not exist. But I have seen Kay using it, so I know it does, and
deserves to be found. Can somebody be nice and put it up somewhere?
2014-07-08 06:25:54 +08:00
|
|
|
|
<constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
file.</para>
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
|
<title>See Also</title>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
|
|
|
|
<citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
|
|
|
|
|
<citerefentry><refentrytitle>fork</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
|
|
|
|
|
<citerefentry><refentrytitle>execve</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
|
man: add a mapping for external manpages
It is annoying when we have dead links on fd.o.
Add project='man-pages|die-net|archlinux' to <citerefentry>-ies.
In generated html, add external links to
http://man7.org/linux/man-pages/man, http://linux.die.net/man/,
https://www.archlinux.org/.
By default, pages in sections 2 and 4 go to man7, since Michael
Kerrisk is the autorative source on kernel related stuff.
The rest of links goes to linux.die.net, because they have the
manpages.
Except for the pacman stuff, since it seems to be only available from
archlinux.org.
Poor gummiboot gets no link, because gummitboot(8) ain't to be found
on the net. According to common wisdom, that would mean that it does
not exist. But I have seen Kay using it, so I know it does, and
deserves to be found. Can somebody be nice and put it up somewhere?
2014-07-08 06:25:54 +08:00
|
|
|
|
<citerefentry project='man-pages'><refentrytitle>credentials</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
|
|
|
|
|
<citerefentry project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
|
|
|
|
|
<citerefentry project='man-pages'><refentrytitle>proc</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
|
2015-03-14 10:26:20 +08:00
|
|
|
|
<citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>
|
2014-01-04 13:08:50 +08:00
|
|
|
|
</para>
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
</refentry>
|