Changeset 88d8a80


Ignore:
Timestamp:
04/15/14 09:13:44 (14 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
ce4a0fe
Parents:
6f60947
Message:

Add a check when logging-in for the existance of the user's home directory, and use the "pw" utility to create it otherwise.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/PCDM/src/pcdm-xprocess.cpp

    rfdf420c r88d8a80  
    100100  } 
    101101 
     102  //Check/create the user's home-dir before dropping privs 
     103  if(!QFile::exists(xhome)){ 
     104    QString hmcmd = "pw usermod "+xuser+" -m"; 
     105    QProcess::execute(hmcmd); 
     106  } 
     107   
    102108  // Get the environment before we drop priv 
    103109  this->setProcessEnvironment( QProcessEnvironment::systemEnvironment() ); //current environment 
     
    107113  //Now allow this user access to the Xserver 
    108114  QString xhostcmd = "xhost si:localuser:"+xuser; 
    109   system(xhostcmd.toUtf8()); 
     115  QProcess::execute(xhostcmd); 
    110116  //And finally set the login user before dropping priv 
    111117  setlogin( xuser.toUtf8() ); 
Note: See TracChangeset for help on using the changeset viewer.