bus-creds.h revision 0258159049d5b381c6097533a69a1b29c3ba7ce2
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering#pragma once
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering/***
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering This file is part of systemd.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Copyright 2013 Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is free software; you can redistribute it and/or modify it
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering under the terms of the GNU Lesser General Public License as published by
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering (at your option) any later version.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is distributed in the hope that it will be useful, but
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Lesser General Public License for more details.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering You should have received a copy of the GNU Lesser General Public License
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering***/
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering#include <stdbool.h>
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering#include "sd-bus.h"
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering#include "time-util.h"
af49ca27ffd790d78dbbb465b978266dfd5c93daLennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringstruct sd_bus_creds {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering bool allocated;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering unsigned n_ref;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering uint64_t mask;
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering
a51c10485af349eb15faa4d1a63b9818bcf3e589Lennart Poettering uid_t uid;
a51c10485af349eb15faa4d1a63b9818bcf3e589Lennart Poettering uid_t euid;
39d8db043b599a7382f94bfc904d5e108af438bdLennart Poettering uid_t suid;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering uid_t fsuid;
eed857b71702f8551b46b66b31fa0d08583cf23cLennart Poettering gid_t gid;
eed857b71702f8551b46b66b31fa0d08583cf23cLennart Poettering gid_t egid;
eed857b71702f8551b46b66b31fa0d08583cf23cLennart Poettering gid_t sgid;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering gid_t fsgid;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering gid_t *supplementary_gids;
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering unsigned n_supplementary_gids;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering pid_t pid;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering usec_t pid_starttime;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering pid_t tid;
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering char *comm;
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering char *tid_comm;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering char *exe;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering char *cmdline;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering size_t cmdline_size;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering char **cmdline_array;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering char *cgroup;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering char *session;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering char *unit;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering char *user_unit;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering char *slice;
6073b6f26ab9fc6bf335faa7073ec443eef093fdTom Gundersen
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering uint8_t *capability;
eed857b71702f8551b46b66b31fa0d08583cf23cLennart Poettering size_t capability_size;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
a51c10485af349eb15faa4d1a63b9818bcf3e589Lennart Poettering uint32_t audit_session_id;
eed857b71702f8551b46b66b31fa0d08583cf23cLennart Poettering uid_t audit_login_uid;
a51c10485af349eb15faa4d1a63b9818bcf3e589Lennart Poettering
af49ca27ffd790d78dbbb465b978266dfd5c93daLennart Poettering char *label;
af49ca27ffd790d78dbbb465b978266dfd5c93daLennart Poettering
19b50b5ba7ee8c1bfb330377309e4bab7a7531d8Lennart Poettering char *unique_name;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering char **well_known_names;
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering
b4f1862df2e45aba90386887d685b8bf3c840e10Daniel Mack char *cgroup_root;
b4f1862df2e45aba90386887d685b8bf3c840e10Daniel Mack
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering char *description, *unescaped_description;
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering};
e1c959948c0e31d6997bcdfbabfbd077784b2baeLennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringsd_bus_creds* bus_creds_new(void);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringvoid bus_creds_done(sd_bus_creds *c);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
1c4baffc1895809bae9ac36b670af90a4cb9cd7dTom Gundersenint bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poetteringint bus_creds_extend_by_pid(sd_bus_creds *c, uint64_t mask, sd_bus_creds **ret);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering