1SD_BUS_GET_NAME_CREDS(3) sd_bus_get_name_creds SD_BUS_GET_NAME_CREDS(3)
2
3
4
6 sd_bus_get_name_creds, sd_bus_get_owner_creds - Query bus client
7 credentials
8
10 #include <systemd/sd-bus.h>
11
12 int sd_bus_get_name_creds(sd_bus *bus, const char *name, uint64_t mask,
13 sd_bus_creds **creds);
14
15 int sd_bus_get_owner_creds(sd_bus *bus, uint64_t mask,
16 sd_bus_creds **creds);
17
19 sd_bus_get_name_creds() queries the credentials of the bus client
20 identified by name. The mask parameter is a combo of SD_BUS_CREDS_*
21 flags that indicate which credential info the caller is interested in.
22 See sd_bus_creds_new_from_pid(3) for a list of possible flags. On
23 success, creds contains a new sd_bus_creds instance with the requested
24 information. Ownership of this instance belongs to the caller and it
25 should be freed once no longer needed by calling sd_bus_creds_unref(3).
26
27 sd_bus_get_owner_creds() queries the credentials of the creator of the
28 given bus. The mask and creds parameters behave the same as in
29 sd_bus_get_name_creds().
30
32 On success, these functions return a non-negative integer. On failure,
33 they return a negative errno-style error code.
34
35 Errors
36 Returned errors may indicate the following problems:
37
38 -EINVAL
39 An argument is invalid.
40
41 -ENOPKG
42 The bus cannot be resolved.
43
44 -EPERM
45 The bus has already been started.
46
47 -ECHILD
48 The bus was created in a different process, library or module
49 instance.
50
51 -ENOMEM
52 Memory allocation failed.
53
55 Functions described here are available as a shared library, which can
56 be compiled against and linked to with the libsystemd pkg-config(1)
57 file.
58
59 The code described here uses getenv(3), which is declared to be not
60 multi-thread-safe. This means that the code calling the functions
61 described here must not call setenv(3) from a parallel thread. It is
62 recommended to only do calls to setenv() from an early phase of the
63 program when no other threads have been started.
64
66 systemd(1), sd-bus(3), sd_bus_creds_unref(3)
67
68
69
70systemd 254 SD_BUS_GET_NAME_CREDS(3)