Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb49519' into 'master'
[systemd] Fix sd_seat_get_sessions. Contributes to JB#49519

See merge request mer-core/systemd!31
  • Loading branch information
Tomin1 committed Apr 15, 2020
2 parents 8b558bd + ce992e8 commit 4813591
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
@@ -0,0 +1,37 @@
From 90b7c52d8320d32db5e42eedddd30558a9d69a63 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 18 May 2017 20:58:23 -0400
Subject: [PATCH] sd-login: read list of uids of sessions from UIDS not
ACTIVE_SESSIONS

As described by Luke Shumaker:

sd_seat_get_sessions looks at /run/systemd/seats/${seat_name}:SESSIONS to get
the list of sessions (which I believe is correct), and at
/run/systemd/seats/${seat_name}:ACTIVE_SESSIONS for the list of users (which
I believe is incorrect); I believe that it should look at the UIDS field for
the list of users. As far as I can tell, the ACTIVE_SESSIONS field is never
even present in the seats file. I also believe that this has been broken
since the function was first committed almost 6 years ago.

Fixes #5743.
---
src/libsystemd/sd-login/sd-login.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c
index 0eadc8c74..69fb5f19b 100644
--- a/src/libsystemd/sd-login/sd-login.c
+++ b/src/libsystemd/sd-login/sd-login.c
@@ -616,7 +616,7 @@ _public_ int sd_seat_get_sessions(const char *seat, char ***sessions, uid_t **ui

r = parse_env_file(p, NEWLINE,
"SESSIONS", &s,
- "ACTIVE_SESSIONS", &t,
+ "UIDS", &t,
NULL);

if (r < 0)
--
2.25.2

4 changes: 4 additions & 0 deletions rpm/systemd.spec
Expand Up @@ -50,6 +50,7 @@ Patch36: systemd-backport-fuzz-decrease-DATA_SIZE_MAX.patch
Patch37: systemd-backport-journal-fix-syslog_parse_identifier.patch
Patch38: systemd-backport-If-the-notification-message-length-is-0-ignore-the-m.patch
Patch39: systemd-backport-pam-systemd-use-secure_getenv-rather-than-getenv.patch
Patch40: systemd-234-sd-login-read-list-of-uids-of-sessions-from-UIDS-not.patch

Patch99: systemd-225_fix_build_with_glibc228.patch

Expand All @@ -74,6 +75,7 @@ BuildRequires: pkgconfig(libcryptsetup) >= 1.6.0
BuildRequires: xz-devel
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Requires: %{name}-libs = %{version}-%{release}
Requires: dbus
Requires: filesystem >= 3
Requires: systemd-config
Expand Down Expand Up @@ -232,6 +234,8 @@ This package includes tests for systemd.
%patch37 -p1
%patch38 -p1
%patch39 -p1
# multiuser fixes
%patch40 -p1
#systemd-225_fix_build_with_glibc228.patch
%patch99 -p1

Expand Down

0 comments on commit 4813591

Please sign in to comment.