sd_bus_creds_get_pid.xml revision 12b42c76672a66c2d4ea7212c14f8f1b5a62b78d
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<!--
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein This file is part of systemd.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Copyright 2014 Zbigniew Jędrzejewski-Szmek
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein systemd is free software; you can redistribute it and/or modify it
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein under the terms of the GNU Lesser General Public License as published by
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein the Free Software Foundation; either version 2.1 of the License, or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein (at your option) any later version.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein systemd is distributed in the hope that it will be useful, but
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein WITHOUT ANY WARRANTY; without even the implied warranty of
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Lesser General Public License for more details.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein You should have received a copy of the GNU Lesser General Public License
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein along with systemd; If not, see <http://www.gnu.org/licenses/>.
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews-->
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<refentry id="sd_bus_creds_get_pid">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refentryinfo>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <title>sd_bus_creds_get_pid</title>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <productname>systemd</productname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <authorgroup>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <author>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <contrib>A monkey with a typewriter</contrib>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <firstname>Zbigniew</firstname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <surname>Jędrzejewski-Szmek</surname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <email>zbyszek@in.waw.pl</email>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </author>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </authorgroup>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </refentryinfo>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refmeta>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refentrytitle>sd_bus_creds_get_pid</refentrytitle>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <manvolnum>3</manvolnum>
92554adb458c7b336e5390c5c9fbf2fcc1276524Mark Andrews </refmeta>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews <refnamediv>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_pid</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_ppid</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_tid</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_uid</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_euid</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_suid</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_fsuid</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_gid</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_egid</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_sgid</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_fsgid</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_supplementary_gids</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_comm</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_tid_comm</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_exe</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_cmdline</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_cgroup</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_unit</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_user_unit</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_slice</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_session</refname>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews <refname>sd_bus_creds_get_owner_uid</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_has_effective_cap</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_has_permitted_cap</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_has_inheritable_cap</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_has_bounding_cap</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_selinux_context</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refname>sd_bus_creds_get_audit_session_id</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_audit_login_uid</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_tty</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_unique_name</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_well_known_names</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refname>sd_bus_creds_get_description</refname>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refpurpose>Retrieve fields from a credentials object</refpurpose>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </refnamediv>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <refsynopsisdiv>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcsynopsis>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_pid</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>pid_t *<parameter>pid</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_ppid</function></funcdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>pid_t *<parameter>ppid</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcdef>int <function>sd_bus_creds_get_tid</function></funcdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>pid_t *<parameter>tid</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews </funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcdef>int <function>sd_bus_creds_get_uid</function></funcdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>uid_t *<parameter>uid</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcdef>int <function>sd_bus_creds_get_euid</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>uid_t *<parameter>uid</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_suid</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews <paramdef>uid_t *<parameter>uid</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_fsuid</function></funcdef>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>uid_t *<parameter>uid</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcdef>int <function>sd_bus_creds_get_gid</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>gid_t *<parameter>gid</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_egid</function></funcdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>gid_t *<parameter>gid</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_sgid</function></funcdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>gid_t *<parameter>gid</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews </funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcdef>int <function>sd_bus_creds_get_fsgid</function></funcdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>gid_t *<parameter>gid</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_supplementary_gids</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>const gid_t **<parameter>gids</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcdef>int <function>sd_bus_creds_get_comm</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>const char **<parameter>comm</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcdef>int <function>sd_bus_creds_get_tid_comm</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>const char **<parameter>comm</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_exe</function></funcdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>const char **<parameter>exe</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews </funcprototype>
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_cmdline</function></funcdef>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>char ***<parameter>cmdline</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <funcdef>int <function>sd_bus_creds_get_cgroup</function></funcdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>const char **<parameter>cgroup</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_unit</function></funcdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>const char **<parameter>unit</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews </funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_user_unit</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews <paramdef>const char **<parameter>unit</parameter></paramdef>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews </funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_slice</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>const char **<parameter>slice</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
297be3708069ef31814d6d75c0d71a50a78feb03Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_session</function></funcdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <paramdef>const char **<parameter>slice</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews </funcprototype>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <funcprototype>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <funcdef>int <function>sd_bus_creds_get_owner_uid</function></funcdef>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <paramdef>uid_t *<parameter>uid</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews </funcprototype>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <funcprototype>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <funcdef>int <function>sd_bus_creds_has_effective_cap</function></funcdef>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <paramdef>int <parameter>capability</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews </funcprototype>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <funcprototype>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <funcdef>int <function>sd_bus_creds_has_permitted_cap</function></funcdef>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <paramdef>int <parameter>capability</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews </funcprototype>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <funcprototype>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <funcdef>int <function>sd_bus_creds_has_inheritable_cap</function></funcdef>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <paramdef>int <parameter>capability</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews </funcprototype>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <funcprototype>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <funcdef>int <function>sd_bus_creds_has_bounding_cap</function></funcdef>
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <paramdef>int <parameter>capability</parameter></paramdef>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_selinux_context</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>const char **<parameter>context</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_audit_session_id</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>uint32_t *<parameter>sessionid</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcdef>int <function>sd_bus_creds_get_audit_login_uid</function></funcdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <paramdef>uid_t *<parameter>loginuid</parameter></paramdef>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <funcprototype>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <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>
<funcprototype>
<funcdef>int <function>sd_bus_creds_get_unique_name</function></funcdef>
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
<paramdef>const char **<parameter>name</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_creds_get_well_known_names</function></funcdef>
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
<paramdef>char ***<parameter>name</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_creds_get_description</function></funcdef>
<paramdef>sd_bus_creds *<parameter>c</parameter></paramdef>
<paramdef>const char **<parameter>name</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>These functions return information from an
<parameter>sd_bus_creds</parameter> credential object. Credential
objects may be created with
<citerefentry><refentrytitle>sd_bus_creds_new_from_pid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
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, with
<citerefentry><refentrytitle>sd_bus_get_owner_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
in which case they describe the credentials of the creator of a
bus, or with
<citerefentry><refentrytitle>sd_bus_message_get_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
in which case they describe the credentials of the sender of the message.</para>
<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>
<para><function>sd_bus_creds_get_tid()</function> will retrieve the
TID (thread identifier).</para>
<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>
<para><function>sd_bus_creds_get_gid()</function> will retrieve the
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>
<para><function>sd_bus_creds_get_comm()</function> will retrieve the
comm field (truncated name of the executable, as stored in
<filename>/proc/<replaceable>pid</replaceable>/comm</filename>).
</para>
<para><function>sd_bus_creds_get_tid_comm()</function> will retrieve
the comm field of the thread (as stored in
<filename>/proc/<replaceable>pid</replaceable>/task/<replaceable>tid</replaceable>/comm</filename>).
</para>
<para><function>sd_bus_creds_get_exe()</function> will retrieve
the path to the program executable (as stored in the
<filename>/proc/<replaceable>pid</replaceable>/exe</filename>
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>
<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>
<para><function>sd_bus_creds_get_cgroup()</function> will retrieve
the cgroup path. See <ulink
url="https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt">cgroups.txt</ulink>.
</para>
<para><function>sd_bus_creds_get_unit()</function> will retrieve
the systemd unit name (in the system instance of systemd) that the
process is part of. See
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
processes that are not part of a unit returns -ENXIO.
</para>
<para><function>sd_bus_creds_get_user_unit()</function> will
retrieve the systemd unit name (in the user instance of systemd)
that the process is part of. See
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
processes that are not part of a user unit returns -ENXIO.
</para>
<para><function>sd_bus_creds_get_slice()</function> will retrieve
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>
<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.
</para>
<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
<citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>
For processes that are not part of a session returns -ENXIO.
</para>
<para><function>sd_bus_creds_has_effective_cap()</function> will
check whether the capability specified by
<parameter>capability</parameter> 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
<citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
and <varname>Capabilities=</varname> and
<varname>CapabilityBoundingSet=</varname> settings in
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
<para><function>sd_bus_creds_has_permitted_cap()</function> is
similar to <function>sd_bus_creds_has_effective_cap()</function>,
but will check the permitted capabilities mask.</para>
<para><function>sd_bus_creds_has_inheritable_cap()</function> is
similar to <function>sd_bus_creds_has_effective_cap()</function>,
but will check the inheritable capabilities mask.</para>
<para><function>sd_bus_creds_has_bounding_cap()</function> is
similar to <function>sd_bus_creds_has_effective_cap()</function>,
but will check the bounding capabilities mask.</para>
<para><function>sd_bus_creds_get_selinux_context()</function> will
retrieve the SELinux security context (label) of the process.</para>
<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>
<para><function>sd_bus_creds_get_audit_login_uid()</function> will
retrieve the audit user login identifier (the identifier of the
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>
<para><function>sd_bus_creds_get_unique_name()</function> will
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>
<para><function>sd_bus_creds_get_well_known_names()</function> will
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>
<para><function>sd_bus_creds_get_description()</function> 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
<citerefentry><refentrytitle>sd_bus_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>
call.</para>
<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 individual 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>
<term><constant>-ENODATA</constant></term>
<listitem><para>Given field is not available in the
credentials object <parameter>c</parameter>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENXIO</constant></term>
<listitem><para>Given field is not specified for the described
process or peer. This will be returned by
<function>sd_bus_get_unit()</function>,
<function>sd_bus_get_user_unit()</function>,
<function>sd_bus_get_slice()</function>,
<function>sd_bus_get_session()</function>, and
<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>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para>Specified pointer parameter is <constant>NULL</constant>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENOMEM</constant></term>
<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
<constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
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>,
<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>,
<citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>