]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: add sd_bus_set_description(3)
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 8 Jul 2018 13:09:23 +0000 (15:09 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 16 Jul 2018 10:36:44 +0000 (12:36 +0200)
man/rules/meson.build
man/sd-bus.xml
man/sd_bus_set_description.xml [new file with mode: 0644]

index 5dadd5fc6cb4a1ae0950290125f848e31a5883e3..9673ef8886f8a498460d20ac2db11c60156042a3 100644 (file)
@@ -242,6 +242,14 @@ manpages = [
    'sd_bus_request_name_async'],
   ''],
  ['sd_bus_set_connected_signal', '3', ['sd_bus_get_connected_signal'], ''],
+ ['sd_bus_set_description',
+  '3',
+  ['sd_bus_get_allow_interactive_authorization',
+   'sd_bus_get_description',
+   'sd_bus_set_allow_interactive_authorization',
+   'sd_bus_set_anonymous',
+   'sd_bus_set_trusted'],
+  ''],
  ['sd_bus_set_sender', '3', ['sd_bus_get_sender'], ''],
  ['sd_bus_set_watch_bind', '3', ['sd_bus_get_watch_bind'], ''],
  ['sd_bus_slot_set_destroy_callback',
index a84af2b878e8c809e2d620be7251701c3c744e24..8c7b60743c92f8691d97f9811cf6ae79ed994e5e 100644 (file)
@@ -71,6 +71,7 @@
 <citerefentry><refentrytitle>sd_bus_reply_method_error</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_request_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_set_connected_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>sd_bus_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_set_sender</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_set_watch_bind</refentrytitle><manvolnum>3</manvolnum></citerefentry>
 <citerefentry><refentrytitle>sd_bus_set_slot_destroy_callback</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
diff --git a/man/sd_bus_set_description.xml b/man/sd_bus_set_description.xml
new file mode 100644 (file)
index 0000000..af02c20
--- /dev/null
@@ -0,0 +1,188 @@
+<?xml version='1.0'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<!--
+  SPDX-License-Identifier: LGPL-2.1+
+-->
+
+<refentry id="sd_bus_set_description" xmlns:xi="http://www.w3.org/2001/XInclude">
+
+  <refentryinfo>
+    <title>sd_bus_set_description</title>
+    <productname>systemd</productname>
+  </refentryinfo>
+
+  <refmeta>
+    <refentrytitle>sd_bus_set_description</refentrytitle>
+    <manvolnum>3</manvolnum>
+  </refmeta>
+
+  <refnamediv>
+    <refname>sd_bus_set_description</refname>
+    <refname>sd_bus_get_description</refname>
+    <refname>sd_bus_set_anonymous</refname>
+    <refname>sd_bus_set_trusted</refname>
+    <refname>sd_bus_set_allow_interactive_authorization</refname>
+    <refname>sd_bus_get_allow_interactive_authorization</refname>
+
+    <refpurpose>Set or query properties of a bus object</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <funcsynopsis>
+      <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
+
+      <funcprototype>
+        <funcdef>int <function>sd_bus_set_description</function></funcdef>
+        <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
+        <paramdef>const char *<parameter>description</parameter></paramdef>
+      </funcprototype>
+
+      <funcprototype>
+        <funcdef>int <function>sd_bus_get_description</function></funcdef>
+        <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
+        <paramdef>const char **<parameter>description</parameter></paramdef>
+      </funcprototype>
+
+      <funcprototype>
+        <funcdef>int <function>sd_bus_set_anonymous</function></funcdef>
+        <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
+        <paramdef>int <parameter>b</parameter></paramdef>
+      </funcprototype>
+
+      <funcprototype>
+        <funcdef>int <function>sd_bus_set_trusted</function></funcdef>
+        <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
+        <paramdef>int <parameter>b</parameter></paramdef>
+      </funcprototype>
+
+      <funcprototype>
+        <funcdef>int <function>sd_bus_set_allow_interactive_authorization</function></funcdef>
+        <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
+        <paramdef>int <parameter>b</parameter></paramdef>
+      </funcprototype>
+
+      <funcprototype>
+        <funcdef>int <function>sd_bus_get_allow_interactive_authorization</function></funcdef>
+        <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
+      </funcprototype>
+    </funcsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title>Description</title>
+
+    <para><function>sd_bus_set_description()</function> 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
+    <parameter>description</parameter> argument may be <constant>NULL</constant>, in
+    which case the description is unset. This function must be called before the bus
+    has been started.</para>
+
+    <para><function>sd_bus_get_description()</function> returns a description string
+    in <parameter>description</parameter>. This string may have been previously set
+    with <function>sd_bus_set_description()</function> or
+    <citerefentry><refentrytitle>sd_bus_open_with_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+    or similar. If not set this way, a default string like <literal>system</literal>
+    or <literal>user</literal> will be returned for the system or user buses,
+    and <constant>NULL</constant> otherwise.</para>
+
+    <para><function>sd_bus_set_anonymous()</function> enables or disables "anonymous
+    authentication", i.e. lack of authentication, of the bus peer. This function must
+    be called before the bus has been started. See the <ulink
+    url="view-source:https://dbus.freedesktop.org/doc/dbus-specification.html#auth-mechanisms">Authentication
+    Mechanisms</ulink> section of the D-Bus specification for details.</para>
+
+    <para><function>sd_bus_set_trusted()</function> sets the "trusted" state on the
+    <parameter>bus</parameter> 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.</para>
+
+    <para><function>sd_bus_set_allow_interactive_authorization()</function>
+    enables or disables interactive authorization for method calls. If true,
+    messages are marked with the
+    <constant>ALLOW_INTERACTIVE_AUTHORIZATION</constant> flag specified by the
+    <ulink
+    url="view-source:https://dbus.freedesktop.org/doc/dbus-specification.html">D-Bus</ulink>
+    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 <ulink
+    url="http://www.freedesktop.org/wiki/Software/polkit">polkit</ulink> or a
+    similar framework.</para>
+
+    <para><function>sd_bus_get_allow_interactive_authorization()</function> returns
+    true if interactive authorization is allowed and false if not.</para>
+  </refsect1>
+
+  <refsect1>
+    <title>Return Value</title>
+
+    <para>On success, these functions return 0 or a positive integer. On failure,
+    they return a negative errno-style error code.</para>
+  </refsect1>
+
+  <refsect1>
+    <title>Errors</title>
+
+    <para>Returned errors may indicate the following problems:</para>
+
+    <variablelist>
+      <varlistentry>
+        <term><constant>-EINVAL</constant></term>
+
+        <listitem><para>An argument is invalid.</para></listitem>
+      </varlistentry>
+    </variablelist>
+
+    <variablelist>
+      <varlistentry>
+        <term><constant>-ENOPKG</constant></term>
+
+        <listitem><para>The bus cannot be resolved.</para></listitem>
+      </varlistentry>
+    </variablelist>
+
+    <variablelist>
+      <varlistentry>
+        <term><constant>-EPERM</constant></term>
+
+        <listitem><para>The bus has already been started.</para></listitem>
+      </varlistentry>
+    </variablelist>
+
+    <variablelist>
+      <varlistentry>
+        <term><constant>-ECHILD</constant></term>
+
+        <listitem><para>The bus was created in a different process.</para></listitem>
+      </varlistentry>
+    </variablelist>
+
+    <variablelist>
+      <varlistentry>
+        <term><constant>-ENOMEM</constant></term>
+
+        <listitem><para>Memory allocation failed.</para></listitem>
+      </varlistentry>
+    </variablelist>
+
+  </refsect1>
+
+  <xi:include href="libsystemd-pkgconfig.xml" />
+
+  <refsect1>
+    <title>See Also</title>
+
+    <para>
+      <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+      <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+      <citerefentry><refentrytitle>sd_bus_default_user</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+      <citerefentry><refentrytitle>sd_bus_default_system</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+      <citerefentry><refentrytitle>sd_bus_open_user</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+      <citerefentry><refentrytitle>sd_bus_open_system</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+    </para>
+  </refsect1>
+
+</refentry>