From 9bcb6edfe419d390acddc2ed7d0c04d37b753ac3 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 28 Sep 2019 21:40:31 +0200 Subject: Do the SELinux relabeling while generating the fstree This commit splits the SELinux relabeling function up into 3 parts: - open the label file - apply relabeling rules to a given file - close the label file The relabeling is done while building the tree (if reading from an input directory) or in a post process step if reading from a desription file. Signed-off-by: David Oberhollenzer --- mkfs/mkfs.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mkfs/mkfs.h') diff --git a/mkfs/mkfs.h b/mkfs/mkfs.h index f00898b..3a139a7 100644 --- a/mkfs/mkfs.h +++ b/mkfs/mkfs.h @@ -68,8 +68,15 @@ enum { void process_command_line(options_t *opt, int argc, char **argv); -int fstree_from_dir(fstree_t *fs, const char *path, unsigned int flags); +int fstree_from_dir(fstree_t *fs, const char *path, void *selinux_handle, + unsigned int flags); -int fstree_relabel_selinux(fstree_t *fs, const char *filename); + +void *selinux_open_context_file(const char *filename); + +int selinux_relable_node(void *sehnd, fstree_t *fs, + tree_node_t *node, const char *path); + +void selinux_close_context_file(void *sehnd); #endif /* MKFS_H */ -- cgit v1.2.3