You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.1 KiB
33 lines
1.1 KiB
11 months ago
|
From 1ac7d4d5ee3bb00a3e7d310f7b8803812940e0a4 Mon Sep 17 00:00:00 2001
|
||
|
From: Yu Watanabe <watanabe.yu+github@gmail.com>
|
||
|
Date: Thu, 14 Feb 2019 10:59:13 +0900
|
||
|
Subject: [PATCH] login: add a missing error check for session_set_leader()
|
||
|
|
||
|
session_set_leader() may fail. If it fails, then manager_start_scope()
|
||
|
will trigger assertion.
|
||
|
|
||
|
This may be related to RHBZ#1663704.
|
||
|
|
||
|
(cherry picked from commit fe3ab8458b9c0ead4b3e14ac25b342d8c34376fe)
|
||
|
|
||
|
Related: #2223602
|
||
|
---
|
||
|
src/login/logind-dbus.c | 4 +++-
|
||
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
|
||
|
index 81aacb4eed..5edcf4e43f 100644
|
||
|
--- a/src/login/logind-dbus.c
|
||
|
+++ b/src/login/logind-dbus.c
|
||
|
@@ -784,7 +784,9 @@ static int method_create_session(sd_bus_message *message, void *userdata, sd_bus
|
||
|
goto fail;
|
||
|
|
||
|
session_set_user(session, user);
|
||
|
- session_set_leader(session, leader);
|
||
|
+ r = session_set_leader(session, leader);
|
||
|
+ if (r < 0)
|
||
|
+ goto fail;
|
||
|
|
||
|
session->type = t;
|
||
|
session->class = c;
|