1:255.13-alt1
[systemd_ALT.git] / man / sd_bus_get_name_creds.xml
blobd7531af92ceb335799ababb0dc8463643b3c830e
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id="sd_bus_get_name_creds" xmlns:xi="http://www.w3.org/2001/XInclude">
8   <refentryinfo>
9     <title>sd_bus_get_name_creds</title>
10     <productname>systemd</productname>
11   </refentryinfo>
13   <refmeta>
14     <refentrytitle>sd_bus_get_name_creds</refentrytitle>
15     <manvolnum>3</manvolnum>
16   </refmeta>
18   <refnamediv>
19     <refname>sd_bus_get_name_creds</refname>
20     <refname>sd_bus_get_owner_creds</refname>
22     <refpurpose>Query bus client credentials</refpurpose>
23   </refnamediv>
25   <refsynopsisdiv>
26     <funcsynopsis>
27       <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
29       <funcprototype>
30         <funcdef>int <function>sd_bus_get_name_creds</function></funcdef>
31         <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
32         <paramdef>const char *<parameter>name</parameter></paramdef>
33         <paramdef>uint64_t <parameter>mask</parameter></paramdef>
34         <paramdef>sd_bus_creds **<parameter>creds</parameter></paramdef>
35       </funcprototype>
37       <funcprototype>
38         <funcdef>int <function>sd_bus_get_owner_creds</function></funcdef>
39         <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
40         <paramdef>uint64_t <parameter>mask</parameter></paramdef>
41         <paramdef>sd_bus_creds **<parameter>creds</parameter></paramdef>
42       </funcprototype>
43     </funcsynopsis>
44   </refsynopsisdiv>
46   <refsect1>
47     <title>Description</title>
49     <para><function>sd_bus_get_name_creds()</function> queries the credentials of the bus client
50     identified by <parameter>name</parameter>. The <parameter>mask</parameter> parameter is a combo of
51     <constant index='false'>SD_BUS_CREDS_*</constant> flags that indicate which credential info the caller is
52     interested in. See
53     <citerefentry><refentrytitle>sd_bus_creds_new_from_pid</refentrytitle><manvolnum>3</manvolnum></citerefentry>
54     for a list of possible flags. On success, <parameter>creds</parameter> contains a new
55     <structname>sd_bus_creds</structname> instance with the requested information. Ownership of this instance
56     belongs to the caller and it should be freed once no longer needed by calling
57     <citerefentry><refentrytitle>sd_bus_creds_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
58     </para>
60     <para><function>sd_bus_get_owner_creds()</function> queries the credentials of the creator of the given
61     bus. The <parameter>mask</parameter> and <parameter>creds</parameter> parameters behave the same as in
62     <function>sd_bus_get_name_creds()</function>.</para>
63   </refsect1>
65   <refsect1>
66     <title>Return Value</title>
68     <para>On success, these functions return a non-negative integer. On failure, they return a negative
69     errno-style error code.</para>
71     <refsect2>
72       <title>Errors</title>
74       <para>Returned errors may indicate the following problems:</para>
76       <variablelist>
77         <varlistentry>
78           <term><constant>-EINVAL</constant></term>
80           <listitem><para>An argument is invalid.</para>
82           <xi:include href="version-info.xml" xpointer="v246"/></listitem>
83         </varlistentry>
85         <varlistentry>
86           <term><constant>-ENOPKG</constant></term>
88           <listitem><para>The bus cannot be resolved.</para>
90           <xi:include href="version-info.xml" xpointer="v246"/></listitem>
91         </varlistentry>
93         <varlistentry>
94           <term><constant>-EPERM</constant></term>
96           <listitem><para>The bus has already been started.</para>
98           <xi:include href="version-info.xml" xpointer="v246"/></listitem>
99         </varlistentry>
101         <varlistentry>
102           <term><constant>-ECHILD</constant></term>
104           <listitem><para>The bus was created in a different process, library or module instance.</para>
106           <xi:include href="version-info.xml" xpointer="v246"/></listitem>
107         </varlistentry>
109         <varlistentry>
110           <term><constant>-ENOMEM</constant></term>
112           <listitem><para>Memory allocation failed.</para>
114           <xi:include href="version-info.xml" xpointer="v246"/></listitem>
115         </varlistentry>
116       </variablelist>
117     </refsect2>
118   </refsect1>
120   <xi:include href="libsystemd-pkgconfig.xml" />
122   <refsect1>
123     <title>History</title>
124     <para><function>sd_bus_get_name_creds()</function> and
125     <function>sd_bus_get_owner_creds()</function> were added in version 246.</para>
126   </refsect1>
128   <refsect1>
129     <title>See Also</title>
131     <para>
132       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
133       <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
134       <citerefentry><refentrytitle>sd_bus_creds_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
135     </para>
136   </refsect1>
137 </refentry>