]> git.pld-linux.org Git - packages/systemd.git/blob - systemd-logind_restart.patch
376542dc9734cc8c9c3f9dbb4d8a23a568456064
[packages/systemd.git] / systemd-logind_restart.patch
1 From 0664daffee63648ff93b5571421149383501d356 Mon Sep 17 00:00:00 2001
2 From: Jan Palus <atler@pld-linux.org>
3 Date: Thu, 11 Jun 2020 18:23:28 +0200
4 Subject: [PATCH] login: filenames in /run/systemd/users are uids
5
6 Fixes: #16146
7 Signed-off-by: Jan Palus <atler@pld-linux.org>
8 ---
9  src/login/logind.c | 9 ++++++++-
10  1 file changed, 8 insertions(+), 1 deletion(-)
11
12 diff --git a/src/login/logind.c b/src/login/logind.c
13 index 5a556f9ea4..3239f7d18a 100644
14 --- a/src/login/logind.c
15 +++ b/src/login/logind.c
16 @@ -328,11 +328,18 @@ static int manager_enumerate_users(Manager *m) {
17  
18          FOREACH_DIRENT(de, d, return -errno) {
19                  User *u;
20 +                uid_t uid;
21  
22                  if (!dirent_is_file(de))
23                          continue;
24  
25 -                k = manager_add_user_by_name(m, de->d_name, &u);
26 +                k = safe_atou(de->d_name, &uid);
27 +                if (k < 0) {
28 +                        r = log_warning_errno(k, "Failed to add user by file name %s, ignoring: %m", de->d_name);
29 +                        continue;
30 +                }
31 +
32 +                k = manager_add_user_by_uid(m, uid, &u);
33                  if (k < 0) {
34                          r = log_warning_errno(k, "Failed to add user by file name %s, ignoring: %m", de->d_name);
35                          continue;
36 -- 
37 2.27.0
38
This page took 0.045767 seconds and 2 git commands to generate.