mirror of
https://github.com/systemd/systemd.git
synced 2026-08-07 08:30:57 +00:00
selinux: fix handling of relative paths when setting up create label
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user