core: Use a subdirectory of /run/ for PrivateDevices=

When we're starting early boot services such as systemd-userdbd.service,
/tmp might not yet be mounted, so let's use a directory in /run instead
which is guaranteed to be available.
This commit is contained in:
Daan De Meyer
2023-10-02 12:23:13 +02:00
parent 4a9e03aa6b
commit cd7f3702eb
5 changed files with 50 additions and 16 deletions
+1
View File
@@ -206,6 +206,7 @@ TEST(protect_kernel_logs) {
NULL,
NULL,
NULL,
RUNTIME_SCOPE_SYSTEM,
NULL);
assert_se(r == 0);
+1
View File
@@ -108,6 +108,7 @@ int main(int argc, char *argv[]) {
NULL,
NULL,
NULL,
RUNTIME_SCOPE_SYSTEM,
NULL);
if (r < 0) {
log_error_errno(r, "Failed to set up namespace: %m");