summaryrefslogtreecommitdiff
path: root/src/shared/seccomp-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-08-09 16:09:04 +0200
committerLennart Poettering <lennart@poettering.net>2017-08-10 15:04:32 +0200
commit165a31c0dbd658444b6f03c95365554200740ebb (patch)
treea00b994a346777851e1ce52fb01176b318b5f0d9 /src/shared/seccomp-util.h
parent39f608e4b0ec2eea0a1a97df14bbcbe511101e18 (diff)
downloadsystemd-165a31c0dbd658444b6f03c95365554200740ebb.tar.gz
core: add two new special ExecStart= character prefixes
This patch adds two new special character prefixes to ExecStart= and friends, in addition to the existing "-", "@" and "+": "!" → much like "+", except with a much reduced effect as it only disables the actual setresuid()/setresgid()/setgroups() calls, but leaves all other security features on, including namespace options. This is very useful in combination with RuntimeDirectory= or DynamicUser= and similar option, as a user is still allocated and used for the runtime directory, but the actual UID/GID dropping is left to the daemon process itself. This should make RuntimeDirectory= a lot more useful for daemons which insist on doing their own privilege dropping. "!!" → Similar to "!", but on systems supporting ambient caps this becomes a NOP. This makes it relatively straightforward to write unit files that make use of ambient capabilities to let systemd drop all privs while retaining compatibility with systems that lack ambient caps, where priv dropping is the left to the daemon codes themselves. This is an alternative approach to #6564 and related PRs.
Diffstat (limited to 'src/shared/seccomp-util.h')
-rw-r--r--src/shared/seccomp-util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/seccomp-util.h b/src/shared/seccomp-util.h
index f6b6889460..0edffa116d 100644
--- a/src/shared/seccomp-util.h
+++ b/src/shared/seccomp-util.h
@@ -67,6 +67,8 @@ extern const SyscallFilterSet syscall_filter_sets[];
const SyscallFilterSet *syscall_filter_set_find(const char *name);
+int seccomp_filter_set_add(Set *s, bool b, const SyscallFilterSet *set);
+
int seccomp_load_syscall_filter_set(uint32_t default_action, const SyscallFilterSet *set, uint32_t action);
int seccomp_load_syscall_filter_set_raw(uint32_t default_action, Set* set, uint32_t action);