Skip to content

Commit

Permalink
login: add a missing error check for session_set_leader()
Browse files Browse the repository at this point in the history
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 fe3ab84)

Related: #2158167
  • Loading branch information
yuwata authored and msekletar committed Jul 5, 2023
1 parent 06b0704 commit 8cb6e2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/login/logind-dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8cb6e2a

Please sign in to comment.