man-pages/man3/sd_bus_set_description.3.html
2021-03-31 01:06:50 +01:00

226 lines
6.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SD_BUS_SET_DESCRIPTION</TITLE>
</HEAD><BODY>
<H1>SD_BUS_SET_DESCRIPTION</H1>
Section: sd_bus_set_description (3)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
sd_bus_set_description, sd_bus_get_description, sd_bus_set_anonymous, sd_bus_set_trusted, sd_bus_set_allow_interactive_authorization, sd_bus_get_allow_interactive_authorization - Set or query properties of a bus object
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>
</B><PRE>
#include &lt;<A HREF="file:///usr/include/systemd/sd-bus.h">systemd/sd-bus.h</A>&gt;
</PRE>
<DL COMPACT>
<DT id="1">
<B>int sd_bus_set_description(sd_bus&nbsp;*</B><I>bus</I><B>, const&nbsp;char&nbsp;*</B><I>description</I><B>);</B>
<DT id="2">
<B>int sd_bus_get_description(sd_bus&nbsp;*</B><I>bus</I><B>, const&nbsp;char&nbsp;**</B><I>description</I><B>);</B>
<DT id="3">
<B>int sd_bus_set_anonymous(sd_bus&nbsp;*</B><I>bus</I><B>, int&nbsp;</B><I>b</I><B>);</B>
<DT id="4">
<B>int sd_bus_set_trusted(sd_bus&nbsp;*</B><I>bus</I><B>, int&nbsp;</B><I>b</I><B>);</B>
<DT id="5">
<B>int sd_bus_set_allow_interactive_authorization(sd_bus&nbsp;*</B><I>bus</I><B>, int&nbsp;</B><I>b</I><B>);</B>
<DT id="6">
<B>int sd_bus_get_allow_interactive_authorization(sd_bus&nbsp;*</B><I>bus</I><B>);</B>
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<B>sd_bus_set_description()</B>
<DD>sets the description string that is used in logging to the specified string. The string is copied internally and freed when the bus object is deallocated. The
<I>description</I>
argument may be
<B>NULL</B>, in which case the description is unset. This function must be called before the bus has been started.
<P>
<B>sd_bus_get_description()</B>
returns a description string in
<I>description</I>. This string may have been previously set with
<B>sd_bus_set_description()</B>
or
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_open_with_description">sd_bus_open_with_description</A></B>(3)
or similar. If not set this way, a default string like
&quot;system&quot;
or
&quot;user&quot;
will be returned for the system or user buses, and
<B>NULL</B>
otherwise.
<P>
<B>sd_bus_set_anonymous()</B>
enables or disables &quot;anonymous authentication&quot;, i.e. lack of authentication, of the bus peer. This function must be called before the bus has been started. See the
m[blue]<B>Authentication Mechanisms</B>m[]<FONT SIZE="-2">[1]</FONT>
section of the D-Bus specification for details.
<P>
<B>sd_bus_set_trusted()</B>
sets the &quot;trusted&quot; state on the
<I>bus</I>
object. If true, all connections on the bus are trusted and access to all privileged and unprivileged methods is granted. This function must be called before the bus has been started.
<P>
<B>sd_bus_set_allow_interactive_authorization()</B>
enables or disables interactive authorization for method calls. If true, messages are marked with the
<B>ALLOW_INTERACTIVE_AUTHORIZATION</B>
flag specified by the
m[blue]<B>D-Bus</B>m[]<FONT SIZE="-2">[2]</FONT>
specification, informing the receiving side that the caller is prepared to wait for interactive authorization, which might take a considerable time to complete. If this flag is set, the user may be queried for passwords or confirmation via
m[blue]<B>polkit</B>m[]<FONT SIZE="-2">[3]</FONT>
or a similar framework.
<P>
<B>sd_bus_get_allow_interactive_authorization()</B>
returns true if interactive authorization is allowed and false if not.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
<P>
On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error code.
<A NAME="lbAF">&nbsp;</A>
<H3>Errors</H3>
<P>
Returned errors may indicate the following problems:
<P>
<B>-EINVAL</B>
<DL COMPACT><DT id="7"><DD>
An argument is invalid.
</DL>
<P>
<B>-ENOPKG</B>
<DL COMPACT><DT id="8"><DD>
The bus cannot be resolved.
</DL>
<P>
<B>-EPERM</B>
<DL COMPACT><DT id="9"><DD>
The bus has already been started.
</DL>
<P>
<B>-ECHILD</B>
<DL COMPACT><DT id="10"><DD>
The bus was created in a different process.
</DL>
<P>
<B>-ENOMEM</B>
<DL COMPACT><DT id="11"><DD>
Memory allocation failed.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>NOTES</H2>
<P>
These APIs are implemented as a shared library, which can be compiled and linked to with the
<B>libsystemd</B>&nbsp;<B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
file.
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?3+sd-bus">sd-bus</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_default_user">sd_bus_default_user</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_default_system">sd_bus_default_system</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_open_user">sd_bus_open_user</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_open_system">sd_bus_open_system</A></B>(3)
<A NAME="lbAI">&nbsp;</A>
<H2>NOTES</H2>
<DL COMPACT>
<DT id="12"> 1.<DD>
Authentication Mechanisms
<DL COMPACT><DT id="13"><DD>
view-source:<A HREF="https://dbus.freedesktop.org/doc/dbus-specification.html#auth-mechanisms">https://dbus.freedesktop.org/doc/dbus-specification.html#auth-mechanisms</A>
</DL>
<DT id="14"> 2.<DD>
D-Bus
<DL COMPACT><DT id="15"><DD>
view-source:<A HREF="https://dbus.freedesktop.org/doc/dbus-specification.html">https://dbus.freedesktop.org/doc/dbus-specification.html</A>
</DL>
<DT id="16"> 3.<DD>
polkit
<DL COMPACT><DT id="17"><DD>
<A HREF="http://www.freedesktop.org/wiki/Software/polkit">http://www.freedesktop.org/wiki/Software/polkit</A>
</DL>
<P>
</DL>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="18"><A HREF="#lbAB">NAME</A><DD>
<DT id="19"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="20"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="21"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DL>
<DT id="22"><A HREF="#lbAF">Errors</A><DD>
</DL>
<DT id="23"><A HREF="#lbAG">NOTES</A><DD>
<DT id="24"><A HREF="#lbAH">SEE ALSO</A><DD>
<DT id="25"><A HREF="#lbAI">NOTES</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:55 GMT, March 31, 2021
</BODY>
</HTML>