SD_BUS_SET_DESCRIPTION(3)

  .SH "NAME" 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
  .SH "SYNOPSIS"

#include <systemd/sd-bus.h>

      .HP u int sd_bus_set_description(sd_bus *bus, const char *description);
      .HP u int sd_bus_get_description(sd_bus *bus, const char **description);
      .HP u int sd_bus_set_anonymous(sd_bus *bus, int b);
      .HP u int sd_bus_set_trusted(sd_bus *bus, int b);
      .HP u int sd_bus_set_allow_interactive_authorization(sd_bus *bus, int b);
      .HP u int sd_bus_get_allow_interactive_authorization(sd_bus *bus);

  .SH "DESCRIPTION"

    .PP sd_bus_set_description() 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 description argument may be NULL, in which case the description is unset. This function must be called before the bus has been started.
    .PP sd_bus_get_description() returns a description string in description. This string may have been previously set with sd_bus_set_description() or sd_bus_open_with_description(3) or similar. If not set this way, a default string like system or user will be returned for the system or user buses, and NULL otherwise.
    .PP sd_bus_set_anonymous() 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 Authentication Mechanisms[1] section of the D-Bus specification for details.
    .PP sd_bus_set_trusted() sets the "trusted" state on the bus 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.
    .PP sd_bus_set_allow_interactive_authorization() enables or disables interactive authorization for method calls. If true, messages are marked with the ALLOW_INTERACTIVE_AUTHORIZATION flag specified by the D-Bus[2] 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 polkit[3] or a similar framework.
    .PP sd_bus_get_allow_interactive_authorization() returns true if interactive authorization is allowed and false if not.

  .SH "RETURN VALUE"

    .PP On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error code.

  .SH "ERRORS"

    .PP Returned errors may indicate the following problems:

      .PP -EINVAL

            An argument is invalid.
          .RE

          .PP -ENOPKG

                The bus cannot be resolved.
              .RE

              .PP -EPERM

                    The bus has already been started.
                  .RE

                  .PP -ECHILD

                        The bus was created in a different process.
                      .RE

                      .PP -ENOMEM

                            Memory allocation failed.
                          .RE

                      .SH "NOTES"

                      .PP These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) file.
                      .SH "SEE ALSO"

                        .PP systemd(1), sd-bus(3), sd_bus_default_user(3), sd_bus_default_system(3), sd_bus_open_user(3), sd_bus_open_system(3)

NOTES

1.  Authentication Mechanisms
    view-source:https://dbus.freedesktop.org/doc/dbus-specification.html#auth-mechanisms

2.  D-Bus
    view-source:https://dbus.freedesktop.org/doc/dbus-specification.html

3.  polkit
    http://www.freedesktop.org/wiki/Software/polkit