From a07e9cfb790f3f5f492f2ff895a9de65e2b00a09 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 24 Oct 2014 01:15:53 +0200 Subject: [PATCH] selinux: fix handling of relative paths when setting up create label --- src/shared/selinux-util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/selinux-util.c b/src/shared/selinux-util.c index 4332c916f..1eddd17d2 100644 --- a/src/shared/selinux-util.c +++ b/src/shared/selinux-util.c @@ -23,6 +23,7 @@ #include #include #include + #ifdef HAVE_SELINUX #include #include @@ -328,7 +329,7 @@ int mac_selinux_create_file_prepare(const char *path, mode_t mode) { if (!newpath) return -ENOMEM; - r = selabel_lookup_raw(label_hnd, &filecon, newpath, S_IFDIR); + r = selabel_lookup_raw(label_hnd, &filecon, newpath, mode); } if (r < 0 && errno != ENOENT) -- 2.30.2