1 /*
2 * SELinux interface.
3 *
4 * Copyright (c) 2020-2022 The strace developers.
5 *
6 * SPDX-License-Identifier: LGPL-2.1-or-later
7 */
8
9 #ifndef STRACE_SECONTEXT_H
10 # define STRACE_SECONTEXT_H
11
12 # include "defs.h"
13
14 void qualify_secontext(const char *const str);
15
16 # ifdef ENABLE_SECONTEXT
17
18 enum secontext_bits {
19 /* Display full context instead of type only */
20 SECONTEXT_FULL,
21 /* Check for context mismatch */
22 SECONTEXT_MISMATCH,
23
24 NUMBER_OF_SECONTEXT_BITS
25 };
26
27 extern struct number_set *secontext_set;
28
29 void selinux_printfdcon(pid_t pid, int fd);
30 void selinux_printfilecon(struct tcb *tcp, const char *path);
31 void selinux_printpidcon(struct tcb *tcp);
32
33 # else
34
35 static inline void selinux_printfdcon(pid_t pid, int fd) {}
36 static inline void selinux_printfilecon(struct tcb *tcp, const char *path) {}
37 static inline void selinux_printpidcon(struct tcb *tcp) {}
38
39 # endif /* ENABLE_SECONTEXT */
40
41 #endif /* !STRACE_SECONTEXT_H */