]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/execute.h
core: add two new special ExecStart= character prefixes
authorLennart Poettering <lennart@poettering.net>
Wed, 9 Aug 2017 14:09:04 +0000 (16:09 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 10 Aug 2017 13:04:32 +0000 (15:04 +0200)
commit165a31c0dbd658444b6f03c95365554200740ebb
treea00b994a346777851e1ce52fb01176b318b5f0d9
parent39f608e4b0ec2eea0a1a97df14bbcbe511101e18
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.
man/systemd.service.xml
src/core/execute.c
src/core/execute.h
src/core/load-fragment.c
src/shared/seccomp-util.c
src/shared/seccomp-util.h