]> git.pld-linux.org Git - packages/systemd.git/commitdiff
attempt to fix logind restart issue
authorJan Palus <atler@pld-linux.org>
Thu, 11 Jun 2020 16:31:49 +0000 (18:31 +0200)
committerJan Palus <atler@pld-linux.org>
Thu, 11 Jun 2020 16:31:49 +0000 (18:31 +0200)
https://github.com/systemd/systemd/issues/16146

systemd-logind_restart.patch [new file with mode: 0644]
systemd.spec

diff --git a/systemd-logind_restart.patch b/systemd-logind_restart.patch
new file mode 100644 (file)
index 0000000..376542d
--- /dev/null
@@ -0,0 +1,38 @@
+From 0664daffee63648ff93b5571421149383501d356 Mon Sep 17 00:00:00 2001
+From: Jan Palus <atler@pld-linux.org>
+Date: Thu, 11 Jun 2020 18:23:28 +0200
+Subject: [PATCH] login: filenames in /run/systemd/users are uids
+
+Fixes: #16146
+Signed-off-by: Jan Palus <atler@pld-linux.org>
+---
+ src/login/logind.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/src/login/logind.c b/src/login/logind.c
+index 5a556f9ea4..3239f7d18a 100644
+--- a/src/login/logind.c
++++ b/src/login/logind.c
+@@ -328,11 +328,18 @@ static int manager_enumerate_users(Manager *m) {
+         FOREACH_DIRENT(de, d, return -errno) {
+                 User *u;
++                uid_t uid;
+                 if (!dirent_is_file(de))
+                         continue;
+-                k = manager_add_user_by_name(m, de->d_name, &u);
++                k = safe_atou(de->d_name, &uid);
++                if (k < 0) {
++                        r = log_warning_errno(k, "Failed to add user by file name %s, ignoring: %m", de->d_name);
++                        continue;
++                }
++
++                k = manager_add_user_by_uid(m, uid, &u);
+                 if (k < 0) {
+                         r = log_warning_errno(k, "Failed to add user by file name %s, ignoring: %m", de->d_name);
+                         continue;
+-- 
+2.27.0
+
index 04298c8284e337adb677125d147eb2a4d2361749..1a60aa5411ba4e0332fc55660fc0b5927115af69 100644 (file)
@@ -77,6 +77,7 @@ Patch12:      uids_gids.patch
 Patch13:       sysctl.patch
 Patch14:       pld-pam-%{name}-user.patch
 Patch15:       %{name}-x32.patch
+Patch16:       %{name}-logind_restart.patch
 URL:           https://www.freedesktop.org/wiki/Software/systemd/
 BuildRequires: acl-devel
 %{?with_audit:BuildRequires:   audit-libs-devel}
@@ -673,6 +674,7 @@ Uzupełnianie parametrów w zsh dla poleceń udev.
 %patch13 -p1
 %patch14 -p1
 %patch15 -p1
+%patch16 -p1
 
 cp -p %{SOURCE2} src/systemd_booted.c
 
This page took 0.292304 seconds and 4 git commands to generate.