summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-03 21:13:30 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-03 21:13:30 +0100
commit34172476c891c2887e5a457bcbe6537115b41d50 (patch)
tree69d59adcb759a3880d8ef6bcacb34cc20d33651d /src
parentd58669f08abefcc4300e1f476b6482e5f7e87098 (diff)
parent4b51966cf6c06250036e428608da92f8640beb96 (diff)
Merge pull request #2508 from fishilico/selinux-logind
Load SELinux labelling systemd in systemd-logind
Diffstat (limited to 'src')
-rw-r--r--src/login/logind-dbus.c1
-rw-r--r--src/login/logind.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 9eda4638e5..ddfeaa1d87 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1228,7 +1228,6 @@ static int attach_device(Manager *m, const char *seat, const char *sysfs) {
return -ENOMEM;
mkdir_p_label("/etc/udev/rules.d", 0755);
- mac_selinux_init("/etc");
r = write_string_file_atomic_label(file, rule);
if (r < 0)
return r;
diff --git a/src/login/logind.c b/src/login/logind.c
index 9723e2f4e0..7e2d114194 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -36,6 +36,7 @@
#include "fd-util.h"
#include "formats-util.h"
#include "logind.h"
+#include "selinux-util.h"
#include "signal-util.h"
#include "strv.h"
#include "udev-util.h"
@@ -1127,6 +1128,12 @@ int main(int argc, char *argv[]) {
goto finish;
}
+ r = mac_selinux_init("/run");
+ if (r < 0) {
+ log_error_errno(r, "Could not initialize labelling: %m");
+ goto finish;
+ }
+
/* Always create the directories people can create inotify
* watches in. Note that some applications might check for the
* existence of /run/systemd/seats/ to determine whether