aboutsummaryrefslogtreecommitdiffstats
path: root/libselinux/src/label.c
diff options
context:
space:
mode:
authorRichard Haines <richard_c_haines@btinternet.com>2011-04-18 16:41:40 +0100
committerEric Paris <eparis@redhat.com>2011-08-02 13:33:21 -0400
commit441cf2ea924c13ed5002012aadd128f71d9e9c9d (patch)
treedacef203ad32fdc16b0e80514943f599f4449edf /libselinux/src/label.c
parente3cab998b48ab293a9962faf9779d70ca339c65d (diff)
downloadandroid_external_selinux-441cf2ea924c13ed5002012aadd128f71d9e9c9d.tar.gz
android_external_selinux-441cf2ea924c13ed5002012aadd128f71d9e9c9d.tar.bz2
android_external_selinux-441cf2ea924c13ed5002012aadd128f71d9e9c9d.zip
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 <richard_c_haines@btinternet.com> Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Dan Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libselinux/src/label.c')
-rw-r--r--libselinux/src/label.c4
1 files changed, 1 insertions, 3 deletions
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);