core: create per-user inaccessible node from the service manager v246.4
authorLennart Poettering <lennart@poettering.net>
Wed, 19 Aug 2020 15:42:33 +0000 (17:42 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 2 Sep 2020 09:49:08 +0000 (11:49 +0200)
commitdc2e82af332b39a2dc615b5f29220df22dfe4e77
tree916da1703823c3214b467dcb65c1614311afa667
parent0b3c497347028bbcc3c6f911967c205b6d0f275f
core: create per-user inaccessible node from the service manager

Previously, we'd create them from user-runtime-dir@.service. That has
one benefit: since this service runs privileged, we can create the full
set of device nodes. It has one major drawback though: it security-wise
problematic to create files/directories in directories as privileged
user in directories owned by unprivileged users, since they can use
symlinks to redirect what we want to do. As a general rule we hence
avoid this logic: only unpriv code should populate unpriv directories.

Hence, let's move this code to an appropriate place in the service
manager. This means we lose the inaccessible block device node, but
since there's already a fallback in place, this shouldn't be too bad.

(cherry picked from commit 3242980582d501ec2adbcc0f794c7161056812e8)
src/core/main.c
src/login/user-runtime-dir.c