]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/libsystemd-bus/bus-creds.h
bus: add new sd_bus_creds object to encapsulate process credentials
[thirdparty/systemd.git] / src / libsystemd-bus / bus-creds.h
CommitLineData
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
29struct 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_length;
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
63sd_bus_creds* bus_creds_new(void);
64
65void bus_creds_done(sd_bus_creds *c);
66
67int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid);