chiark / gitweb /
81b852a5963320542420c026e2979c50d32f8220
[elogind.git] / src / libsystemd / sd-bus / bus-creds.h
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;
35         gid_t gid;
36         pid_t pid;
37         usec_t pid_starttime;
38         pid_t tid;
39
40         char *comm;
41         char *tid_comm;
42         char *exe;
43
44         char *cmdline;
45         size_t cmdline_size;
46         char **cmdline_array;
47
48         char *cgroup;
49         char *session;
50         char *unit;
51         char *user_unit;
52         char *slice;
53
54         uint8_t *capability;
55         size_t capability_size;
56
57         uint32_t audit_session_id;
58         uid_t audit_login_uid;
59
60         char *label;
61
62         char *unique_name;
63
64         char **well_known_names;
65
66         char *cgroup_root;
67
68         char *conn_name, *unescaped_conn_name;
69 };
70
71 sd_bus_creds* bus_creds_new(void);
72
73 void bus_creds_done(sd_bus_creds *c);
74
75 int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid);
76
77 int bus_creds_extend_by_pid(sd_bus_creds *c, uint64_t mask, sd_bus_creds **ret);