Skip to content

Commit 0990a5e

Browse files
author
Martin Briza
committed
Bail on chdir failure
Fixes #303
1 parent 84b2319 commit 0990a5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/helper/UserSession.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ namespace SDDM {
7474
bail(2);
7575
if (setuid(pw->pw_uid) != 0)
7676
bail(2);
77-
chdir(pw->pw_dir);
77+
if (chdir(pw->pw_dir) != 0)
78+
bail(2);
7879

7980
//we cannot use setStandardError file as this code is run in the child process
8081
//we want to redirect after we setuid so that .xsession-errors is owned by the user

0 commit comments

Comments
 (0)