chiark / gitweb /
cgroup: support prefix "-" in cgroups whitelisting entries (#4687)
authorDongsu Park <dongsu@endocode.com>
Tue, 29 Nov 2016 19:16:55 +0000 (20:16 +0100)
committerSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:35 +0000 (17:58 +0200)
commit26e8e0deeb31275306ece5d43b511b150c77724c
tree03d65aa794510c91ac12baa3d24d8e2ac28a01eb
parent62383061a34dc8233b3e26c49271d5cb43fcb0f6
cgroup: support prefix "-" in cgroups whitelisting entries (#4687)

So far elogind-nspawn container has been creating files under
/run/elogind/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/elogind/inaccessible/chr
  Couldn't stat device /run/elogind/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