2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2013-11-28 17:50:02 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include "sd-bus.h"
|
|
|
|
|
|
|
|
struct sd_bus_creds {
|
|
|
|
bool allocated;
|
|
|
|
unsigned n_ref;
|
2015-04-21 00:58:08 +02:00
|
|
|
|
2013-11-28 17:50:02 +01:00
|
|
|
uint64_t mask;
|
2015-04-21 00:58:08 +02:00
|
|
|
uint64_t augmented;
|
2013-11-28 17:50:02 +01:00
|
|
|
|
|
|
|
uid_t uid;
|
sd-bus: update to current kernel version, by splitting off the extended KDBUS_ITEM_PIDS structure from KDBUS_ITEM_CREDS
Also:
- adds support for euid, suid, fsuid, egid, sgid, fsgid fields.
- makes augmentation of creds with data from /proc explicitly
controllable to give apps better control over this, given that this is
racy.
- enables augmentation for kdbus connections (previously we only did it
for dbus1). This is useful since with recent kdbus versions it is
possible for clients to control the metadata they want to send.
- changes sd_bus_query_sender_privilege() to take the euid of the client
into consideration, if known
- when we don't have permissions to read augmentation data from /proc,
don't fail, just don't add the data in
2014-11-24 21:41:40 +01:00
|
|
|
uid_t euid;
|
|
|
|
uid_t suid;
|
|
|
|
uid_t fsuid;
|
2013-11-28 17:50:02 +01:00
|
|
|
gid_t gid;
|
sd-bus: update to current kernel version, by splitting off the extended KDBUS_ITEM_PIDS structure from KDBUS_ITEM_CREDS
Also:
- adds support for euid, suid, fsuid, egid, sgid, fsgid fields.
- makes augmentation of creds with data from /proc explicitly
controllable to give apps better control over this, given that this is
racy.
- enables augmentation for kdbus connections (previously we only did it
for dbus1). This is useful since with recent kdbus versions it is
possible for clients to control the metadata they want to send.
- changes sd_bus_query_sender_privilege() to take the euid of the client
into consideration, if known
- when we don't have permissions to read augmentation data from /proc,
don't fail, just don't add the data in
2014-11-24 21:41:40 +01:00
|
|
|
gid_t egid;
|
|
|
|
gid_t sgid;
|
|
|
|
gid_t fsgid;
|
|
|
|
|
2014-11-25 13:21:23 +01:00
|
|
|
gid_t *supplementary_gids;
|
|
|
|
unsigned n_supplementary_gids;
|
|
|
|
|
2015-04-21 20:58:09 +02:00
|
|
|
pid_t ppid;
|
2013-11-28 17:50:02 +01:00
|
|
|
pid_t pid;
|
|
|
|
pid_t tid;
|
|
|
|
|
|
|
|
char *comm;
|
|
|
|
char *tid_comm;
|
|
|
|
char *exe;
|
|
|
|
|
|
|
|
char *cmdline;
|
2013-11-30 04:14:10 +01:00
|
|
|
size_t cmdline_size;
|
2013-11-28 17:50:02 +01:00
|
|
|
char **cmdline_array;
|
|
|
|
|
|
|
|
char *cgroup;
|
|
|
|
char *session;
|
|
|
|
char *unit;
|
|
|
|
char *user_unit;
|
|
|
|
char *slice;
|
2015-04-30 11:58:06 +02:00
|
|
|
char *user_slice;
|
2013-11-28 17:50:02 +01:00
|
|
|
|
2015-04-23 19:43:40 +02:00
|
|
|
char *tty;
|
|
|
|
|
2014-12-30 09:09:41 +01:00
|
|
|
uint32_t *capability;
|
2013-11-28 17:50:02 +01:00
|
|
|
|
|
|
|
uint32_t audit_session_id;
|
|
|
|
uid_t audit_login_uid;
|
|
|
|
|
|
|
|
char *label;
|
2013-11-30 04:14:10 +01:00
|
|
|
|
|
|
|
char *unique_name;
|
|
|
|
|
2013-12-04 23:36:02 +01:00
|
|
|
char **well_known_names;
|
2014-11-27 12:52:13 +01:00
|
|
|
bool well_known_names_driver:1;
|
|
|
|
bool well_known_names_local:1;
|
2013-12-24 19:31:44 +01:00
|
|
|
|
|
|
|
char *cgroup_root;
|
2014-01-22 16:28:58 +01:00
|
|
|
|
2014-11-04 16:13:49 +01:00
|
|
|
char *description, *unescaped_description;
|
2013-11-28 17:50:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
2013-11-30 04:14:10 +01:00
|
|
|
|
|
|
|
int bus_creds_extend_by_pid(sd_bus_creds *c, uint64_t mask, sd_bus_creds **ret);
|