chiark / gitweb /
logind: chown+chmod /run/user/$UID if mount(tmpfs) fails with EPERM
authorChristian Seiler <christian@iwakd.de>
Tue, 27 Jan 2015 17:58:40 +0000 (18:58 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 Jan 2015 17:58:40 +0000 (18:58 +0100)
commit11c6476a08af7a8a9ae6a2d0f8370587f7b31663
tree141141196d3c4670d6c05bed548800ab5919df22
parent4d858e7d9f39038713f760d7acc64acf7bba2aa7
logind: chown+chmod /run/user/$UID if mount(tmpfs) fails with EPERM

In containers without CAP_SYS_ADMIN, it is not possible to mount tmpfs
(or any filesystem for that matter) on top of /run/user/$UID.
Previously, logind just failed in such a situation.

Now, logind will resort to chown+chmod of the directory instead. This
allows logind still to work in those environments, although without the
guarantees it provides (i.e. users not being able to DOS /run or other
users' /run/user/$UID space) when CAP_SYS_ADMIN is available.
src/login/logind-user.c