summaryrefslogtreecommitdiffstats
path: root/kdm/kfrontend/kgapp.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-14 07:17:16 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-14 07:17:16 +0000
commit7bf4b536155b448b01f7e127be787177305a3b28 (patch)
tree6e7c2c4e8cc801960912f0b12f1fd88420e5eb0c /kdm/kfrontend/kgapp.cpp
parent9edbe3af0952290b348c005f8095137444dcb16c (diff)
downloadtdebase-7bf4b536155b448b01f7e127be787177305a3b28.tar.gz
tdebase-7bf4b536155b448b01f7e127be787177305a3b28.zip
Reload kompmgr settings on user switch
Check for null passwd struct in kdm kgapp git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1247005 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdm/kfrontend/kgapp.cpp')
-rw-r--r--kdm/kfrontend/kgapp.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/kdm/kfrontend/kgapp.cpp b/kdm/kfrontend/kgapp.cpp
index b57b4371d..677b5ec2a 100644
--- a/kdm/kfrontend/kgapp.cpp
+++ b/kdm/kfrontend/kgapp.cpp
@@ -366,13 +366,15 @@ kg_main( const char *argv0 )
// Change process UID
// Get user UID
passwd* userinfo = getpwnam(login_user.ascii());
- TQString newuid = TQString("%1").arg(userinfo->pw_uid);
- // kompmgr allows us to change its uid in this manner:
- // 1.) Send SIGUSER1
- // 2.) Send the new UID to it on the command line
- comp->kill(SIGUSR1);
- comp->writeStdin(newuid.ascii(), newuid.length());
- usleep(50000); // Give the above function some time to execute. Note that on REALLY slow systems this could fail, leaving kompmgr running as root. TODO: Look into ways to make this more robust.
+ if (userinfo) {
+ TQString newuid = TQString("%1").arg(userinfo->pw_uid);
+ // kompmgr allows us to change its uid in this manner:
+ // 1.) Send SIGUSER1
+ // 2.) Send the new UID to it on the command line
+ comp->kill(SIGUSR1);
+ comp->writeStdin(newuid.ascii(), newuid.length());
+ usleep(50000); // Give the above function some time to execute. Note that on REALLY slow systems this could fail, leaving kompmgr running as root. TODO: Look into ways to make this more robust.
+ }
}
comp->closeStdin();
comp->detach();