systemd/0001-core-create-userdb-root-directory-with-correct-label.patch
Zbigniew Jędrzejewski-Szmek bde1d0acee Version 262~rc1
- See https://raw.githubusercontent.com/systemd/systemd/v262-rc1/NEWS.
  Too many changes to list or discuss here.
2026-09-03 10:28:05 +02:00

42 lines
1.8 KiB
Diff

From 7d7965620490b28ccfb9cf45a91b8596be811c90 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Sat, 30 Aug 2025 13:55:56 +0200
Subject: [PATCH 1/2] core: create userdb root directory with correct label
Set up the /run/systemd/userdb directory with the default SELinux context
on creation.
With version 257.7-1 on Debian the directory was automatically created with the
correct label. Starting with version 258 (only tested with 258~rc3-1) it no
longer is. Regression introduced in 736349958efe34089131ca88950e2e5bb391d36a.
[zjs: edited the patch to apply comments from review and update the description.]
---
src/core/varlink.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/core/varlink.c b/src/core/varlink.c
index 79a198f14d..f32071a161 100644
--- a/src/core/varlink.c
+++ b/src/core/varlink.c
@@ -9,6 +9,7 @@
#include "json-util.h"
#include "manager.h"
#include "metrics.h"
+#include "mkdir.h"
#include "path-util.h"
#include "pidref.h"
#include "stdio-util.h"
@@ -523,7 +524,11 @@ static int varlink_server_listen_many_idempotent_sentinel(
if (!known_fresh && varlink_server_contains_socket(s, address))
continue;
- r = sd_varlink_server_listen_address(s, address, 0666 | SD_VARLINK_SERVER_MODE_MKDIR_0755);
+ r = mkdir_parents_label(address, 0755);
+ if (r < 0)
+ log_warning_errno(r, "Failed to create parent directory of '%s', ignoring: %m", address);
+
+ r = sd_varlink_server_listen_address(s, address, 0666);
if (r < 0) {
log_error_errno(r, "Failed to bind to varlink socket '%s': %m", address);
break;