summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-26 02:28:52 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-26 02:28:52 +0100
commitf513e420c8b1a1d4c13092cd378f048b69793497 (patch)
tree8bc6f9e42cec765ca4bc7f1b769177e9a3fb1016 /src/core/unit.c
parent9c423fbf2a11bf9c936017c0f1e06ea2e4e82a40 (diff)
exec: imply NoNewPriviliges= only when seccomp filters are used in user mode
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 9d54147adb..05470739d2 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2817,6 +2817,14 @@ int unit_exec_context_patch_defaults(Unit *u, ExecContext *c) {
return r;
}
+ if (u->manager->running_as == SYSTEMD_USER &&
+ (c->syscall_whitelist ||
+ !set_isempty(c->syscall_filter) ||
+ !set_isempty(c->syscall_archs) ||
+ c->address_families_whitelist ||
+ !set_isempty(c->address_families)))
+ c->no_new_privileges = true;
+
return 0;
}