From: Lennart Poettering Date: Thu, 23 Oct 2014 23:15:53 +0000 (+0200) Subject: selinux: fix handling of relative paths when setting up create label X-Git-Tag: v217~91 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a07e9cfb790f3f5f492f2ff895a9de65e2b00a09;p=elogind.git selinux: fix handling of relative paths when setting up create label --- 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)