summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukasz Skalski <l.skalski@samsung.com>2014-10-09 11:02:47 +0200
committerLennart Poettering <lennart@poettering.net>2014-10-09 11:38:59 +0200
commit374738d55b2bc4ab07c22f9a0be95a76de1c9478 (patch)
tree227c82e0171382ccf41e7ec4d72c45642a1de284 /src
parent2134b5ef6b5c944036d051381f4bd7b7e61ef373 (diff)
logind: mount per-user tmpfs with 'smackfsroot=*' for smack enabled systems
Diffstat (limited to 'src')
-rw-r--r--src/login/logind-user.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index d48eca47f0..3847496c15 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -37,6 +37,7 @@
#include "conf-parser.h"
#include "clean-ipc.h"
#include "logind-user.h"
+#include "smack-util.h"
User* user_new(Manager *m, uid_t uid, gid_t gid, const char *name) {
User *u;
@@ -325,7 +326,12 @@ static int user_mkdir_runtime_path(User *u) {
mkdir(p, 0700);
- if (asprintf(&t, "mode=0700,uid=" UID_FMT ",gid=" GID_FMT ",size=%zu", u->uid, u->gid, u->manager->runtime_dir_size) < 0) {
+ if (use_smack())
+ r = asprintf(&t, "mode=0700,smackfsroot=*,uid=" UID_FMT ",gid=" GID_FMT ",size=%zu", u->uid, u->gid, u->manager->runtime_dir_size);
+ else
+ r = asprintf(&t, "mode=0700,uid=" UID_FMT ",gid=" GID_FMT ",size=%zu", u->uid, u->gid, u->manager->runtime_dir_size);
+
+ if (r < 0) {
r = log_oom();
goto fail;
}