]> git.ipfire.org Git - thirdparty/systemd.git/commit - man/systemd.exec.xml
core: add a concept of "dynamic" user ids, that are allocated as long as a service...
authorLennart Poettering <lennart@poettering.net>
Thu, 14 Jul 2016 10:37:28 +0000 (12:37 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Jul 2016 13:53:45 +0000 (15:53 +0200)
commit29206d4619843252c2e04f20dc03c246547600a2
treea30c2f5b2e90f016c5ed46452ac27264f2afae1c
parent66dccd8d85aac9f029c626aac8d2b7e58d239b47
core: add a concept of "dynamic" user ids, that are allocated as long as a service is running

This adds a new boolean setting DynamicUser= to service files. If set, a new
user will be allocated dynamically when the unit is started, and released when
it is stopped. The user ID is allocated from the range 61184..65519. The user
will not be added to /etc/passwd (but an NSS module to be added later should
make it show up in getent passwd).

For now, care should be taken that the service writes no files to disk, since
this might result in files owned by UIDs that might get assigned dynamically to
a different service later on. Later patches will tighten sandboxing in order to
ensure that this cannot happen, except for a few selected directories.

A simple way to test this is:

        systemd-run -p DynamicUser=1 /bin/sleep 99999
26 files changed:
Makefile.am
man/systemd.exec.xml
src/basic/socket-util.c
src/basic/socket-util.h
src/core/dbus-execute.c
src/core/dbus-manager.c
src/core/dynamic-user.c [new file with mode: 0644]
src/core/dynamic-user.h [new file with mode: 0644]
src/core/execute.c
src/core/execute.h
src/core/load-fragment-gperf.gperf.m4
src/core/manager.c
src/core/manager.h
src/core/mount.c
src/core/mount.h
src/core/service.c
src/core/service.h
src/core/socket.c
src/core/socket.h
src/core/swap.c
src/core/swap.h
src/core/unit.c
src/core/unit.h
src/libsystemd/sd-bus/bus-common-errors.c
src/libsystemd/sd-bus/bus-common-errors.h
src/shared/bus-unit-util.c