[PC-BSD Commits] r18722 - pcbsd-projects/PCDM

svn at pcbsd.org svn at pcbsd.org
Thu Aug 30 11:18:26 PDT 2012


Author: kenmoore
Date: 2012-08-30 18:18:26 +0000 (Thu, 30 Aug 2012)
New Revision: 18722

Modified:
   pcbsd-projects/PCDM/pcdm-backend.cpp
   pcbsd-projects/PCDM/pcdm-backend.h
   pcbsd-projects/PCDM/startPCDM
Log:
Make some debugging changes to the PCDM startup process for DE's



Modified: pcbsd-projects/PCDM/pcdm-backend.cpp
===================================================================
--- pcbsd-projects/PCDM/pcdm-backend.cpp	2012-08-30 18:08:31 UTC (rev 18721)
+++ pcbsd-projects/PCDM/pcdm-backend.cpp	2012-08-30 18:18:26 UTC (rev 18722)
@@ -1,5 +1,6 @@
 #include <sys/types.h>
 #include <security/pam_appl.h>
+#include <QProcess>
 
 #include "pcdm-backend.h"
 #include "pcdm-config.h"
@@ -64,19 +65,19 @@
 
 bool Backend::startUserLogin(QString username, QString password, QString xBinary){
   bool allowed = verifyUsernamePassword(username, password);
-  //qDebug() << "PAM Authorization:" << allowed;
   if(allowed){
     qDebug() << "Username/Password Authorized";
     //Setup the system command to run the selected DE
-    QString cmd = "su -m "+username+" -c "+xBinary;
-    startXSession(cmd);
+    //QString cmd = "su -m "+username+" -c "+xBinary;
+    startXSession(xBinary, username);
   }else{
     qDebug() << "Username/Password not authorized";	  
   }
   return allowed;
 }
 
-void Backend::startXSession(QString cmd){
+void Backend::startXSession(QString cmd, QString username){
+  /*
   QFile xfile("/usr/local/bin/.pcdm-startup");
   if(xfile.open(QIODevice::WriteOnly | QIODevice::Text)){
     QTextStream out(&xfile);
@@ -84,7 +85,18 @@
     out << cmd << "\n";
     xfile.close();
   }
-  //system(cmd.toUtf8());  //create the command to start the DE
+  */
+  //Create the external process
+  QProcess* p = new QProcess(0);
+  //Setup the process environment
+  QProcessEnvironment environ = p->processEnvironment(); //current environment
+  
+  //p->setProcessEnvironment(environ);
+  //Startup the process
+  qDebug() << "Current Envronment:" << environ;
+  qDebug() << "Debug Mode: not starting DE"
+  //p->startDetached(cmd);
+
 }
 
 QString Backend::getUsernameFromDisplayname(QString dspname){

Modified: pcbsd-projects/PCDM/pcdm-backend.h
===================================================================
--- pcbsd-projects/PCDM/pcdm-backend.h	2012-08-30 18:08:31 UTC (rev 18721)
+++ pcbsd-projects/PCDM/pcdm-backend.h	2012-08-30 18:18:26 UTC (rev 18722)
@@ -44,7 +44,7 @@
     static void loadXSessionsData();
     static QStringList readXSessionsFile(QString, QString);
     static bool verifyUsernamePassword(QString, QString);
-    static void startXSession(QString);
+    static void startXSession(QString,QString);
     
     
 };

Modified: pcbsd-projects/PCDM/startPCDM
===================================================================
--- pcbsd-projects/PCDM/startPCDM	2012-08-30 18:08:31 UTC (rev 18721)
+++ pcbsd-projects/PCDM/startPCDM	2012-08-30 18:18:26 UTC (rev 18722)
@@ -1,9 +1,10 @@
 #!/bin/sh
+#Startup this function with the following command:
+#   xinit "/usr/local/bin/startPCDM" :8
+#
 
 #Start the normal PCDM GUI
-xinit /usr/local/bin/PCDM :8
-#Kill the x session ons the PCDM GUI  is done
-xkill -display :8
+/usr/local/bin/PCDM
 
 #If a desktop session command has been created, run it then remove it
 if [ -f /usr/local/bin/.pcdm-startup ]; then



More information about the Commits mailing list