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