From 441cf2ea924c13ed5002012aadd128f71d9e9c9d Mon Sep 17 00:00:00 2001 From: Richard Haines Date: Mon, 18 Apr 2011 16:41:40 +0100 Subject: libselinux: selabel_open fix processing of substitution files libselinux selabel_open function always processed the substitution files (if installed) from the active policy contexts/files/file_contexts.subs and subs_dist irrespective of the backend type or SELABEL_OPT_PATH setting. This patch now processes the correct subs files when selabel_open is called with SELABEL_CTX_FILE. The other backends could also process their own substitution files if needed in their own areas. [move the init declaration to label_internal.h - eparis] Signed-off-by: Richard Haines Signed-off-by: Eric Paris Acked-by: Dan Walsh --- libselinux/src/label.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libselinux/src/label.c') diff --git a/libselinux/src/label.c b/libselinux/src/label.c index ba316df5..7d71e724 100644 --- a/libselinux/src/label.c +++ b/libselinux/src/label.c @@ -56,7 +56,7 @@ static char *selabel_sub(struct selabel_sub *ptr, const char *src) return NULL; } -static struct selabel_sub *selabel_subs_init(const char *path,struct selabel_sub *list) +struct selabel_sub *selabel_subs_init(const char *path,struct selabel_sub *list) { char buf[1024]; FILE *cfg = fopen(path, "r"); @@ -161,8 +161,6 @@ struct selabel_handle *selabel_open(unsigned int backend, rec->validating = selabel_is_validate_set(opts, nopts); rec->subs = NULL; - rec->subs = selabel_subs_init(selinux_file_context_subs_dist_path(), rec->subs); - rec->subs = selabel_subs_init(selinux_file_context_subs_path(), rec->subs); if ((*initfuncs[backend])(rec, opts, nopts)) { free(rec); -- cgit v1.2.3