]>
Commit | Line | Data |
---|---|---|
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 <systemd/sd-bus.h></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 | ||
119 | <para>On success, these functions return 0 or a positive integer. On failure, | |
120 | they return a negative errno-style error code.</para> | |
121 | </refsect1> | |
122 | ||
123 | <refsect1> | |
124 | <title>Errors</title> | |
125 | ||
126 | <para>Returned errors may indicate the following problems:</para> | |
127 | ||
128 | <variablelist> | |
129 | <varlistentry> | |
130 | <term><constant>-EINVAL</constant></term> | |
131 | ||
132 | <listitem><para>An argument is invalid.</para></listitem> | |
133 | </varlistentry> | |
134 | </variablelist> | |
135 | ||
136 | <variablelist> | |
137 | <varlistentry> | |
138 | <term><constant>-ENOPKG</constant></term> | |
139 | ||
140 | <listitem><para>The bus cannot be resolved.</para></listitem> | |
141 | </varlistentry> | |
142 | </variablelist> | |
143 | ||
144 | <variablelist> | |
145 | <varlistentry> | |
146 | <term><constant>-EPERM</constant></term> | |
147 | ||
148 | <listitem><para>The bus has already been started.</para></listitem> | |
149 | </varlistentry> | |
150 | </variablelist> | |
151 | ||
152 | <variablelist> | |
153 | <varlistentry> | |
154 | <term><constant>-ECHILD</constant></term> | |
155 | ||
156 | <listitem><para>The bus was created in a different process.</para></listitem> | |
157 | </varlistentry> | |
158 | </variablelist> | |
159 | ||
160 | <variablelist> | |
161 | <varlistentry> | |
162 | <term><constant>-ENOMEM</constant></term> | |
163 | ||
164 | <listitem><para>Memory allocation failed.</para></listitem> | |
165 | </varlistentry> | |
166 | </variablelist> | |
167 | ||
168 | </refsect1> | |
169 | ||
170 | <xi:include href="libsystemd-pkgconfig.xml" /> | |
171 | ||
172 | <refsect1> | |
173 | <title>See Also</title> | |
174 | ||
175 | <para> | |
176 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
177 | <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
178 | <citerefentry><refentrytitle>sd_bus_default_user</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
179 | <citerefentry><refentrytitle>sd_bus_default_system</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
180 | <citerefentry><refentrytitle>sd_bus_open_user</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
181 | <citerefentry><refentrytitle>sd_bus_open_system</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
182 | </para> | |
183 | </refsect1> | |
184 | ||
185 | </refentry> |