]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/libsystemd/sd-bus/bus-creds.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / libsystemd / sd-bus / bus-creds.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
5b12334d
LP
2#pragma once
3
4/***
5 This file is part of systemd.
6
7 Copyright 2013 Lennart Poettering
8
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
13
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
21***/
22
23#include <stdbool.h>
24
25#include "sd-bus.h"
5b12334d
LP
26
27struct sd_bus_creds {
28 bool allocated;
29 unsigned n_ref;
0f514420 30
5b12334d 31 uint64_t mask;
0f514420 32 uint64_t augmented;
5b12334d
LP
33
34 uid_t uid;
705a415f
LP
35 uid_t euid;
36 uid_t suid;
37 uid_t fsuid;
5b12334d 38 gid_t gid;
705a415f
LP
39 gid_t egid;
40 gid_t sgid;
41 gid_t fsgid;
42
02581590
LP
43 gid_t *supplementary_gids;
44 unsigned n_supplementary_gids;
45
1386e47d 46 pid_t ppid;
5b12334d 47 pid_t pid;
5b12334d
LP
48 pid_t tid;
49
50 char *comm;
51 char *tid_comm;
52 char *exe;
53
54 char *cmdline;
49b832c5 55 size_t cmdline_size;
5b12334d
LP
56 char **cmdline_array;
57
58 char *cgroup;
59 char *session;
60 char *unit;
61 char *user_unit;
62 char *slice;
329ac4bc 63 char *user_slice;
5b12334d 64
4761e880
LP
65 char *tty;
66
7d9fcc2b 67 uint32_t *capability;
5b12334d
LP
68
69 uint32_t audit_session_id;
70 uid_t audit_login_uid;
71
72 char *label;
49b832c5
LP
73
74 char *unique_name;
75
65dae17a 76 char **well_known_names;
fb6d9b77
LP
77 bool well_known_names_driver:1;
78 bool well_known_names_local:1;
751bc6ac
LP
79
80 char *cgroup_root;
cccb0b2c 81
455971c1 82 char *description, *unescaped_description;
5b12334d
LP
83};
84
85sd_bus_creds* bus_creds_new(void);
86
87void bus_creds_done(sd_bus_creds *c);
88
89int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid);
49b832c5
LP
90
91int bus_creds_extend_by_pid(sd_bus_creds *c, uint64_t mask, sd_bus_creds **ret);