1SD_BUS_SET_DESCRIPTION(3) sd_bus_set_description SD_BUS_SET_DESCRIPTION(3)
2
3
4
6 sd_bus_set_description, sd_bus_get_description, sd_bus_set_anonymous,
7 sd_bus_set_trusted, sd_bus_set_allow_interactive_authorization,
8 sd_bus_get_allow_interactive_authorization - Set or query properties of
9 a bus object
10
12 #include <systemd/sd-bus.h>
13
14 int sd_bus_set_description(sd_bus *bus, const char *description);
15
16 int sd_bus_get_description(sd_bus *bus, const char **description);
17
18 int sd_bus_set_anonymous(sd_bus *bus, int b);
19
20 int sd_bus_set_trusted(sd_bus *bus, int b);
21
22 int sd_bus_set_allow_interactive_authorization(sd_bus *bus, int b);
23
24 int sd_bus_get_allow_interactive_authorization(sd_bus *bus);
25
27 sd_bus_set_description() sets the description string that is used in
28 logging to the specified string. The string is copied internally and
29 freed when the bus object is deallocated. The description argument may
30 be NULL, in which case the description is unset. This function must be
31 called before the bus has been started.
32
33 sd_bus_get_description() returns a description string in description.
34 This string may have been previously set with sd_bus_set_description()
35 or sd_bus_open_with_description(3) or similar. If not set this way, a
36 default string like "system" or "user" will be returned for the system
37 or user buses, and NULL otherwise.
38
39 sd_bus_set_anonymous() enables or disables "anonymous authentication",
40 i.e. lack of authentication, of the bus peer. This function must be
41 called before the bus has been started. See the Authentication
42 Mechanisms[1] section of the D-Bus specification for details.
43
44 sd_bus_set_trusted() sets the "trusted" state on the bus object. If
45 true, all connections on the bus are trusted and access to all
46 privileged and unprivileged methods is granted. This function must be
47 called before the bus has been started.
48
49 sd_bus_set_allow_interactive_authorization() enables or disables
50 interactive authorization for method calls. If true, messages are
51 marked with the ALLOW_INTERACTIVE_AUTHORIZATION flag specified by the
52 D-Bus[2] specification, informing the receiving side that the caller is
53 prepared to wait for interactive authorization, which might take a
54 considerable time to complete. If this flag is set, the user may be
55 queried for passwords or confirmation via polkit[3] or a similar
56 framework.
57
58 sd_bus_get_allow_interactive_authorization() returns true if
59 interactive authorization is allowed and false if not.
60
62 On success, these functions return 0 or a positive integer. On failure,
63 they return a negative errno-style error code.
64
65 Errors
66 Returned errors may indicate the following problems:
67
68 -EINVAL
69 An argument is invalid.
70
71 -ENOPKG
72 The bus cannot be resolved.
73
74 -EPERM
75 The bus has already been started.
76
77 -ECHILD
78 The bus was created in a different process.
79
80 -ENOMEM
81 Memory allocation failed.
82
84 These APIs are implemented as a shared library, which can be compiled
85 and linked to with the libsystemd pkg-config(1) file.
86
88 systemd(1), sd-bus(3), sd_bus_default_user(3),
89 sd_bus_default_system(3), sd_bus_open_user(3), sd_bus_open_system(3)
90
92 1. Authentication Mechanisms
93 view-source:https://dbus.freedesktop.org/doc/dbus-specification.html#auth-mechanisms
94
95 2. D-Bus
96 view-source:https://dbus.freedesktop.org/doc/dbus-specification.html
97
98 3. polkit
99 http://www.freedesktop.org/wiki/Software/polkit
100
101
102
103systemd 243 SD_BUS_SET_DESCRIPTION(3)