chiark / gitweb /
selinux: fix handling of relative paths when setting up create label
authorLennart Poettering <lennart@poettering.net>
Thu, 23 Oct 2014 23:15:53 +0000 (01:15 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Oct 2014 23:15:53 +0000 (01:15 +0200)
src/shared/selinux-util.c

index 4332c916fa11c248bd7f3bdb85355d4afd9a9f2a..1eddd17d2797ff797254aab1faf43c34f58affb4 100644 (file)
@@ -23,6 +23,7 @@
 #include <unistd.h>
 #include <malloc.h>
 #include <sys/un.h>
+
 #ifdef HAVE_SELINUX
 #include <selinux/selinux.h>
 #include <selinux/label.h>
@@ -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)