]> git.ipfire.org Git - thirdparty/systemd.git/commit
cgroup: support prefix "-" in cgroups whitelisting entries (#4687)
authorDongsu Park <dongsu@endocode.com>
Tue, 29 Nov 2016 19:16:55 +0000 (20:16 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 29 Nov 2016 19:16:55 +0000 (20:16 +0100)
commite7330dfe14b1965fe8a2e25df248f45d46cfb26d
treec88b9e28dec5ba5d8b234a567df80fd7543d32fb
parenta9d2d40dbabd241354f62b57f407fb23c20d7860
cgroup: support prefix "-" in cgroups whitelisting entries (#4687)

So far systemd-nspawn container has been creating files under
/run/systemd/inaccessible, no matter whether it's running in user
namespace or not. That's fine for regular files, dirs, socks, fifos.
However, it's not for block and character devices, because kernel
doesn't allow them to be created under user namespace. It results
in warnings at booting like that:

====
  Couldn't stat device /run/systemd/inaccessible/chr
  Couldn't stat device /run/systemd/inaccessible/blk
====

Thus we need to have the cgroups whitelisting handler to silently ignore
a file, when the device path is prefixed with "-". That's exactly the
same convention used in directives like ReadOnlyPaths=. Also insert the
prefix "-" to inaccessible entries.
src/core/cgroup.c