[PC-BSD Commits] r18861 - pcbsd-projects/PCDM
svn at pcbsd.org
svn at pcbsd.org
Wed Sep 5 10:42:54 PDT 2012
Author: kenmoore
Date: 2012-09-05 17:42:53 +0000 (Wed, 05 Sep 2012)
New Revision: 18861
Modified:
pcbsd-projects/PCDM/pcdm-backend.cpp
Log:
Try a new setup for starting the desktop login process for PCDM
Modified: pcbsd-projects/PCDM/pcdm-backend.cpp
===================================================================
--- pcbsd-projects/PCDM/pcdm-backend.cpp 2012-09-05 17:07:56 UTC (rev 18860)
+++ pcbsd-projects/PCDM/pcdm-backend.cpp 2012-09-05 17:42:53 UTC (rev 18861)
@@ -90,30 +90,31 @@
}
//Use the saved information and clear it
QString username = saveUsername;
- QString cmd = saveX;
+ QString cmd = "su -m "+username+" "+saveX; //change user keeping the current environment variables
saveUsername.clear();
saveX.clear();
- //Get the user's home directory
+ // Get the user's home directory
QString homeDir = getUserHomeDir(username);
- //Create the external process
+ // Create the external process
QProcess* p = new QProcess(0);
- //Setup the process environment
+ // Setup the process environment
QProcessEnvironment environ = QProcessEnvironment::systemEnvironment(); //current environment
Backend::log("System Environment: " + environ.toStringList().join(" ") );
- environ.insert("LOGNAME",username); //Login name
- environ.insert("USERNAME",username); //
- environ.insert("USER",username);
- environ.insert("HOME",homeDir);
- environ.insert("PATH",environ.value("PATH")+":"+homeDir+"/bin");
+ // Setup any specialized environment variables
+ //environ.insert("LOGNAME",username); //Login name
+ //environ.insert("USERNAME",username); //
+ //environ.insert("USER",username); //Set the user properly
+ //environ.insert("HOME",homeDir); // set the proper home directory
+ //environ.insert("PATH",environ.value("PATH")+":"+homeDir+"/bin"); // Append the user's home dir to the path
p->setProcessEnvironment(environ);
- //Startup the process
+ // Startup the process
Backend::log("Modified Environment: " + environ.toStringList().join(" ") );
Backend::log("Debug Mode: not starting DE");
p->start(cmd);
- //Wait for the process to start before continuing
+ // Wait for the process to start before continuing
p->waitForStarted();
- //Now Wait for the process to finish
+ // Now Wait for the process to finish
p->waitForFinished(-1); //do not time-out
}
More information about the Commits
mailing list