From 0bbd84e31ec8bbe8d1e28e981c577fd56c8b8664 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 11 May 2019 00:27:06 +0200 Subject: Add SELinux labeling to fstree code Use libselinux to lookup the context attributes from a file. Signed-off-by: David Oberhollenzer --- include/fstree.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/fstree.h') diff --git a/include/fstree.h b/include/fstree.h index 64541a3..a7d19c2 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -388,4 +388,16 @@ int fstree_from_file(fstree_t *fs, const char *filename); */ void fstree_sort(fstree_t *fs); +/** + * @brief Add labels from an SELinux labeling file to all tree nodes + * + * @memberof fstree_t + * + * @param fs A pointer to an fstree object + * @param filename The name of the SELinux context file + * + * @return Zero on success, -1 on failure + */ +int fstree_relabel_selinux(fstree_t *fs, const char *filename); + #endif /* FSTREE_H */ -- cgit v1.2.3