]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd_bus_set_description.xml
travis: use UBSan checks from OSS-Fuzz
[thirdparty/systemd.git] / man / sd_bus_set_description.xml
CommitLineData
3c775de6 1<?xml version='1.0'?>
3a54a157
ZJS
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
0307f791 4<!-- SPDX-License-Identifier: LGPL-2.1+ -->
3c775de6
ZJS
5
6<refentry id="sd_bus_set_description" xmlns:xi="http://www.w3.org/2001/XInclude">
7
8 <refentryinfo>
9 <title>sd_bus_set_description</title>
10 <productname>systemd</productname>
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>sd_bus_set_description</refentrytitle>
15 <manvolnum>3</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>sd_bus_set_description</refname>
20 <refname>sd_bus_get_description</refname>
21 <refname>sd_bus_set_anonymous</refname>
22 <refname>sd_bus_set_trusted</refname>
23 <refname>sd_bus_set_allow_interactive_authorization</refname>
24 <refname>sd_bus_get_allow_interactive_authorization</refname>
25
26 <refpurpose>Set or query properties of a bus object</refpurpose>
27 </refnamediv>
28
29 <refsynopsisdiv>
30 <funcsynopsis>
31 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
32
33 <funcprototype>
34 <funcdef>int <function>sd_bus_set_description</function></funcdef>
35 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
36 <paramdef>const char *<parameter>description</parameter></paramdef>
37 </funcprototype>
38
39 <funcprototype>
40 <funcdef>int <function>sd_bus_get_description</function></funcdef>
41 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
42 <paramdef>const char **<parameter>description</parameter></paramdef>
43 </funcprototype>
44
45 <funcprototype>
46 <funcdef>int <function>sd_bus_set_anonymous</function></funcdef>
47 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
48 <paramdef>int <parameter>b</parameter></paramdef>
49 </funcprototype>
50
51 <funcprototype>
52 <funcdef>int <function>sd_bus_set_trusted</function></funcdef>
53 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
54 <paramdef>int <parameter>b</parameter></paramdef>
55 </funcprototype>
56
57 <funcprototype>
58 <funcdef>int <function>sd_bus_set_allow_interactive_authorization</function></funcdef>
59 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
60 <paramdef>int <parameter>b</parameter></paramdef>
61 </funcprototype>
62
63 <funcprototype>
64 <funcdef>int <function>sd_bus_get_allow_interactive_authorization</function></funcdef>
65 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
66 </funcprototype>
67 </funcsynopsis>
68 </refsynopsisdiv>
69
70 <refsect1>
71 <title>Description</title>
72
73 <para><function>sd_bus_set_description()</function> sets the description string
74 that is used in logging to the specified string. The string is copied internally
75 and freed when the bus object is deallocated. The
76 <parameter>description</parameter> argument may be <constant>NULL</constant>, in
77 which case the description is unset. This function must be called before the bus
78 has been started.</para>
79
80 <para><function>sd_bus_get_description()</function> returns a description string
81 in <parameter>description</parameter>. This string may have been previously set
82 with <function>sd_bus_set_description()</function> or
83 <citerefentry><refentrytitle>sd_bus_open_with_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>
84 or similar. If not set this way, a default string like <literal>system</literal>
85 or <literal>user</literal> will be returned for the system or user buses,
86 and <constant>NULL</constant> otherwise.</para>
87
88 <para><function>sd_bus_set_anonymous()</function> enables or disables "anonymous
89 authentication", i.e. lack of authentication, of the bus peer. This function must
90 be called before the bus has been started. See the <ulink
91 url="view-source:https://dbus.freedesktop.org/doc/dbus-specification.html#auth-mechanisms">Authentication
92 Mechanisms</ulink> section of the D-Bus specification for details.</para>
93
94 <para><function>sd_bus_set_trusted()</function> sets the "trusted" state on the
95 <parameter>bus</parameter> object. If true, all connections on the bus are
96 trusted and access to all privileged and unprivileged methods is granted. This
97 function must be called before the bus has been started.</para>
98
99 <para><function>sd_bus_set_allow_interactive_authorization()</function>
100 enables or disables interactive authorization for method calls. If true,
101 messages are marked with the
102 <constant>ALLOW_INTERACTIVE_AUTHORIZATION</constant> flag specified by the
103 <ulink
104 url="view-source:https://dbus.freedesktop.org/doc/dbus-specification.html">D-Bus</ulink>
105 specification, informing the receiving side that the caller is prepared to
106 wait for interactive authorization, which might take a considerable time to
107 complete. If this flag is set, the user may be queried for passwords or
108 confirmation via <ulink
109 url="http://www.freedesktop.org/wiki/Software/polkit">polkit</ulink> or a
110 similar framework.</para>
111
112 <para><function>sd_bus_get_allow_interactive_authorization()</function> returns
113 true if interactive authorization is allowed and false if not.</para>
114 </refsect1>
115
116 <refsect1>
117 <title>Return Value</title>
118
b1de39de
ZJS
119 <para>On success, these functions return 0 or a positive integer. On failure, they return a negative
120 errno-style error code.</para>
3c775de6 121
b1de39de
ZJS
122 <refsect2>
123 <title>Errors</title>
3c775de6 124
b1de39de 125 <para>Returned errors may indicate the following problems:</para>
3c775de6 126
b1de39de
ZJS
127 <variablelist>
128 <varlistentry>
129 <term><constant>-EINVAL</constant></term>
3c775de6 130
b1de39de
ZJS
131 <listitem><para>An argument is invalid.</para></listitem>
132 </varlistentry>
3c775de6 133
b1de39de
ZJS
134 <varlistentry>
135 <term><constant>-ENOPKG</constant></term>
3c775de6 136
b1de39de
ZJS
137 <listitem><para>The bus cannot be resolved.</para></listitem>
138 </varlistentry>
3c775de6 139
b1de39de
ZJS
140 <varlistentry>
141 <term><constant>-EPERM</constant></term>
3c775de6 142
b1de39de
ZJS
143 <listitem><para>The bus has already been started.</para></listitem>
144 </varlistentry>
3c775de6 145
b1de39de
ZJS
146 <varlistentry>
147 <term><constant>-ECHILD</constant></term>
3c775de6 148
b1de39de
ZJS
149 <listitem><para>The bus was created in a different process.</para></listitem>
150 </varlistentry>
3c775de6 151
b1de39de
ZJS
152 <varlistentry>
153 <term><constant>-ENOMEM</constant></term>
3c775de6 154
b1de39de
ZJS
155 <listitem><para>Memory allocation failed.</para></listitem>
156 </varlistentry>
157 </variablelist>
3c775de6 158
b1de39de 159 </refsect2>
3c775de6
ZJS
160 </refsect1>
161
162 <xi:include href="libsystemd-pkgconfig.xml" />
163
164 <refsect1>
165 <title>See Also</title>
166
167 <para>
168 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
169 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
170 <citerefentry><refentrytitle>sd_bus_default_user</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
171 <citerefentry><refentrytitle>sd_bus_default_system</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
172 <citerefentry><refentrytitle>sd_bus_open_user</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
173 <citerefentry><refentrytitle>sd_bus_open_system</refentrytitle><manvolnum>3</manvolnum></citerefentry>
174 </para>
175 </refsect1>
176
177</refentry>