Debian Codegraph @

src/shared/apparmor-util.h

raw
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include "shared-forward.h"
5
6 #if HAVE_APPARMOR
7 # include <sys/apparmor.h>
8
9 # include "dlfcn-util.h"
10
11 extern DLSYM_PROTOTYPE(aa_change_onexec);
12 extern DLSYM_PROTOTYPE(aa_change_profile);
13 extern DLSYM_PROTOTYPE(aa_features_new_from_kernel);
14 extern DLSYM_PROTOTYPE(aa_features_unref);
15 extern DLSYM_PROTOTYPE(aa_policy_cache_dir_path_preview);
16 extern DLSYM_PROTOTYPE(aa_policy_cache_new);
17 extern DLSYM_PROTOTYPE(aa_policy_cache_replace_all);
18 extern DLSYM_PROTOTYPE(aa_policy_cache_unref);
19
20 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(aa_features*, sym_aa_features_unref, aa_features_unrefp, NULL);
21 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(aa_policy_cache*, sym_aa_policy_cache_unref, aa_policy_cache_unrefp, NULL);
22 bool mac_apparmor_use(void);
23 #else
24 static inline bool mac_apparmor_use(void) {
25 return false;
26 }
27 #endif
28
29 int dlopen_libapparmor(int log_level);