aboutsummaryrefslogtreecommitdiffstats
path: root/x11/slim/files/patch-switchuser.cpp
blob: 056a134359f6669da9c81de1ea36f9c201e5480f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
--- switchuser.cpp  2009-10-14 16:28:20.000000000 +0800
+++ switchuser.cpp  2009-10-14 16:34:23.000000000 +0800
@@ -38,6 +38,8 @@
 
 void SwitchUser::SetUserId() {
     if( (Pw == 0) ||
+            (setsid() == -1) ||
+            (setlogin(Pw->pw_name) != 0) ||
             (initgroups(Pw->pw_name, Pw->pw_gid) != 0) ||
             (setgid(Pw->pw_gid) != 0) ||
             (setuid(Pw->pw_uid) != 0) ) {