]>
Commit | Line | Data |
---|---|---|
5b12334d LP |
1 | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
2 | ||
3 | #pragma once | |
4 | ||
5 | /*** | |
6 | This file is part of systemd. | |
7 | ||
8 | Copyright 2013 Lennart Poettering | |
9 | ||
10 | systemd is free software; you can redistribute it and/or modify it | |
11 | under the terms of the GNU Lesser General Public License as published by | |
12 | the Free Software Foundation; either version 2.1 of the License, or | |
13 | (at your option) any later version. | |
14 | ||
15 | systemd is distributed in the hope that it will be useful, but | |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 | Lesser General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU Lesser General Public License | |
21 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
22 | ***/ | |
23 | ||
24 | #include <stdbool.h> | |
25 | ||
26 | #include "sd-bus.h" | |
27 | #include "time-util.h" | |
28 | ||
29 | struct sd_bus_creds { | |
30 | bool allocated; | |
31 | unsigned n_ref; | |
32 | uint64_t mask; | |
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 | ||
5b12334d | 46 | pid_t pid; |
5b12334d LP |
47 | pid_t tid; |
48 | ||
49 | char *comm; | |
50 | char *tid_comm; | |
51 | char *exe; | |
52 | ||
53 | char *cmdline; | |
49b832c5 | 54 | size_t cmdline_size; |
5b12334d LP |
55 | char **cmdline_array; |
56 | ||
57 | char *cgroup; | |
58 | char *session; | |
59 | char *unit; | |
60 | char *user_unit; | |
61 | char *slice; | |
62 | ||
63 | uint8_t *capability; | |
5b12334d LP |
64 | |
65 | uint32_t audit_session_id; | |
66 | uid_t audit_login_uid; | |
67 | ||
68 | char *label; | |
49b832c5 LP |
69 | |
70 | char *unique_name; | |
71 | ||
65dae17a | 72 | char **well_known_names; |
fb6d9b77 LP |
73 | bool well_known_names_driver:1; |
74 | bool well_known_names_local:1; | |
751bc6ac LP |
75 | |
76 | char *cgroup_root; | |
cccb0b2c | 77 | |
455971c1 | 78 | char *description, *unescaped_description; |
5b12334d LP |
79 | }; |
80 | ||
81 | sd_bus_creds* bus_creds_new(void); | |
82 | ||
83 | void bus_creds_done(sd_bus_creds *c); | |
84 | ||
85 | int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid); | |
49b832c5 LP |
86 | |
87 | int bus_creds_extend_by_pid(sd_bus_creds *c, uint64_t mask, sd_bus_creds **ret); |