Changeset fb67bb2


Ignore:
Timestamp:
07/16/13 09:36:24 (13 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
1ac96e6
Parents:
5b07f4a
Message:

Fix how we source .xprofile, and add our user to other groups

File:
1 edited

Legend:

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

    r5b07f4a rfb67bb2  
    102102  } 
    103103 
     104  // Setup our other groups 
     105  if (initgroups(xuser.toLatin1(), pw->pw_gid) < 0) { 
     106      qDebug() << "initgroups() failed!"; 
     107      emit InvalidLogin();  //Make sure the GUI knows that it was a failure 
     108      setgid(0); 
     109      return FALSE; 
     110  } 
     111 
    104112  // Lets drop to user privs 
    105113  if (setuid(pw->pw_uid) < 0) { 
     
    108116      return FALSE; 
    109117  } 
    110  
    111   /* 
    112   struct login_cap *lc; 
    113   lc = login_getclass(pw->pw_class); 
    114   if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL)) { 
    115   QMessageBox::warning(wid, "My Application", "setusercfailed", QMessageBox::Ok, QMessageBox::Ok); 
    116         emit InvalidLogin();  //Make sure the GUI knows that it was a failure 
    117         return FALSE; 
    118   } 
    119   */ 
    120118 
    121119  //Startup the PAM session 
     
    199197  } 
    200198 
     199  // Setup our other groups 
     200  if (initgroups(xuser.toLatin1(), pw->pw_gid) < 0) { 
     201      qDebug() << "initgroups() failed!"; 
     202      emit InvalidLogin();  //Make sure the GUI knows that it was a failure 
     203      setgid(0); 
     204      return; 
     205  }  
     206 
    201207  // Lets drop to user privs 
    202208  if (setuid(pw->pw_uid) < 0) { 
     
    209215  // Configure the DE startup command 
    210216  //  - Setup to run the user's <home-dir>/.xprofile startup script 
    211   //if(QFile::exists(xhome+"/.xprofile")){ 
    212   //  cmd.append("(/bin/sh "+xhome+"/.xprofile) &; ");  //make sure to start it in parallel 
    213   //} 
     217  if(QFile::exists(xhome+"/.xprofile")){ 
     218    cmd.append(". "+xhome+"/.xprofile; ");  //make sure to start it in parallel 
     219  } 
    214220  //  - Add the DE startup command to the end 
    215221  cmd.append("dbus-launch --exit-with-session "+xcmd); 
     
    239245  qDebug() << "Start the desktop"; 
    240246  system(cmd.toLatin1()); 
     247  system("logout"); 
    241248} 
    242249 
Note: See TracChangeset for help on using the changeset viewer.