mirror of
https://github.com/systemd/systemd.git
synced 2025-01-31 05:47:30 +03:00
selinux: fix handling of relative paths when setting up create label
This commit is contained in:
parent
989fc2c61c
commit
a07e9cfb79
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user