]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd_bus_get_name_creds.xml
man: add version information for functions
[thirdparty/systemd.git] / man / sd_bus_get_name_creds.xml
CommitLineData
425d5cec
DDM
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">
db9ecf05 4<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
425d5cec
DDM
5
6<refentry id="sd_bus_get_name_creds" xmlns:xi="http://www.w3.org/2001/XInclude">
7
8 <refentryinfo>
9 <title>sd_bus_get_name_creds</title>
10 <productname>systemd</productname>
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>sd_bus_get_name_creds</refentrytitle>
15 <manvolnum>3</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>sd_bus_get_name_creds</refname>
20 <refname>sd_bus_get_owner_creds</refname>
21
22 <refpurpose>Query bus client credentials</refpurpose>
23 </refnamediv>
24
25 <refsynopsisdiv>
26 <funcsynopsis>
27 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
28
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>
36
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>
45
46 <refsect1>
47 <title>Description</title>
48
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
7b679a18
DDM
57 <citerefentry><refentrytitle>sd_bus_creds_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
58 </para>
425d5cec
DDM
59
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>
64
65 <refsect1>
66 <title>Return Value</title>
67
68 <para>On success, these functions return a non-negative integer. On failure, they return a negative
69 errno-style error code.</para>
70
71 <refsect2>
72 <title>Errors</title>
73
74 <para>Returned errors may indicate the following problems:</para>
75
76 <variablelist>
77 <varlistentry>
78 <term><constant>-EINVAL</constant></term>
79
ec07c3c8
AK
80 <listitem><para>An argument is invalid.</para>
81
82 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
425d5cec
DDM
83 </varlistentry>
84
85 <varlistentry>
86 <term><constant>-ENOPKG</constant></term>
87
ec07c3c8
AK
88 <listitem><para>The bus cannot be resolved.</para>
89
90 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
425d5cec
DDM
91 </varlistentry>
92
93 <varlistentry>
94 <term><constant>-EPERM</constant></term>
95
ec07c3c8
AK
96 <listitem><para>The bus has already been started.</para>
97
98 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
425d5cec
DDM
99 </varlistentry>
100
101 <varlistentry>
102 <term><constant>-ECHILD</constant></term>
103
ec07c3c8
AK
104 <listitem><para>The bus was created in a different process, library or module instance.</para>
105
106 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
425d5cec
DDM
107 </varlistentry>
108
109 <varlistentry>
110 <term><constant>-ENOMEM</constant></term>
111
ec07c3c8
AK
112 <listitem><para>Memory allocation failed.</para>
113
114 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
425d5cec
DDM
115 </varlistentry>
116 </variablelist>
117 </refsect2>
118 </refsect1>
119
120 <xi:include href="libsystemd-pkgconfig.xml" />
121
69106f47
AK
122 <refsect1>
123 <title>History</title>
124 <para><function>sd_bus_get_name_creds()</function> was added in version 246.</para>
125 <para><function>sd_bus_get_owner_creds()</function> was added in version 246.</para>
126 </refsect1>
127
425d5cec
DDM
128 <refsect1>
129 <title>See Also</title>
130
131 <para>
132 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
7b679a18
DDM
133 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
134 <citerefentry><refentrytitle>sd_bus_creds_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
425d5cec
DDM
135 </para>
136 </refsect1>
425d5cec 137</refentry>