Commit | Line | Data |
---|---|---|
18710679 | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2019 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
18710679 | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: GPL-2.0-only |
18710679 | 5 | * |
18710679 JG |
6 | */ |
7 | ||
8 | #ifndef LTTNG_CREDENTIALS_H | |
9 | #define LTTNG_CREDENTIALS_H | |
10 | ||
11 | #include <sys/types.h> | |
894e6e1c | 12 | #include <stdbool.h> |
18710679 | 13 | |
ff588497 JR |
14 | #include "optional.h" |
15 | ||
18710679 | 16 | struct lttng_credentials { |
ff588497 JR |
17 | LTTNG_OPTIONAL(uid_t) uid; |
18 | LTTNG_OPTIONAL(gid_t) gid; | |
18710679 JG |
19 | }; |
20 | ||
ff588497 JR |
21 | uid_t lttng_credentials_get_uid(const struct lttng_credentials *creds); |
22 | gid_t lttng_credentials_get_gid(const struct lttng_credentials *creds); | |
23 | ||
24 | bool lttng_credentials_is_equal_uid(const struct lttng_credentials *a, | |
25 | const struct lttng_credentials *b); | |
26 | ||
27 | bool lttng_credentials_is_equal_gid(const struct lttng_credentials *a, | |
28 | const struct lttng_credentials *b); | |
29 | ||
894e6e1c JR |
30 | bool lttng_credentials_is_equal(const struct lttng_credentials *a, |
31 | const struct lttng_credentials *b); | |
32 | ||
18710679 | 33 | #endif /* LTTNG_CREDENTIALS_H */ |