Changeset 72c9698


Ignore:
Timestamp:
11/07/13 09:47:01 (10 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
44640c4
Parents:
2aa342f
Message:

Fix up PCDM compilation on 10.x

Location:
src-qt4/PCDM/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/PCDM/src/dialogKeyboard.cpp

    r1620346 r72c9698  
    6969  QString model, layout, variant; 
    7070 
    71   if ( ! comboBoxKeyboardModel->currentIndex() == -1 ) 
     71  if ( ! (comboBoxKeyboardModel->currentIndex() == -1) ) 
    7272     return; 
    7373  if ( ! listKbLayouts->currentItem() ) 
  • src-qt4/PCDM/src/loginWidget.cpp

    r1d2d46a r72c9698  
    6868  //Setup the Signals/Slots 
    6969  connect(pushLogin,SIGNAL(clicked()),this,SLOT(slotTryLogin())); 
    70   connect(pushUserIcon,SIGNAL(triggered(QAction*)), this, SLOT(slotUserActivated(QAction*))); 
    71   connect(userIcon,SIGNAL(triggered(QAction*)), this, SLOT(slotUserActivated(QAction*))); 
     70  connect(pushUserIcon,SIGNAL(triggered(QAction*)), this, SLOT(slotUserActivated())); 
     71  connect(userIcon,SIGNAL(triggered(QAction*)), this, SLOT(slotUserActivated())); 
    7272  connect(listUsers,SIGNAL(activated(int)),this,SLOT(slotChooseUser(int))); 
    7373  connect(listUserBig,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(slotUserSelected()) ); 
     
    136136//    PRIVATE SLOTS 
    137137//------------------------------------- 
    138 void LoginWidget::slotUserActivated(QAction* act){ 
     138void LoginWidget::slotUserActivated(){ 
    139139    //Toggle the user box as to what is visible 
    140140    if(!userSelected){  
  • src-qt4/PCDM/src/loginWidget.h

    r1d2d46a r72c9698  
    7474 
    7575  private slots: 
    76         void slotUserActivated(QAction*); 
     76        void slotUserActivated(); 
    7777        //void slotUserClicked(QListWidgetItem*); 
    7878        void slotUserHighlighted(int); 
  • src-qt4/PCDM/src/pcdm-xprocess.cpp

    rfbbd5c0 r72c9698  
    2929  pam_session_open = FALSE; 
    3030  //Setup the finished signal/slot 
    31   connect( this, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotCleanup(int, QProcess::ExitStatus)) ); 
     31  connect( this, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotCleanup()) ); 
    3232} 
    3333 
     
    157157} 
    158158 
    159 void XProcess::slotCleanup(int exitCode, QProcess::ExitStatus status){ 
     159void XProcess::slotCleanup(){ 
    160160  pam_shutdown(); //make sure that PAM shuts down properly 
    161161  //Now remove this user's access to the Xserver 
     
    187187  this->setWorkingDirectory(xhome); //set the current directory to the user's home directory 
    188188} 
    189 /* 
    190 //Start the desktop in the current process with C functions 
    191 void XProcess::startDesktop(){ 
    192   //Check for PAM username/password validity 
    193   if( !pam_checkPW() ){ qDebug() << "Invalid username/password"; pam_shutdown(); return; } 
    194   //Startup the PAM session 
    195   if( !pam_startSession() ){ qDebug() << "Unable to open PAM session"; pam_shutdown(); return; } 
    196   pam_session_open = TRUE; //flag that pam has an open session 
    197    
    198   //Save the current user/desktop as the last login 
    199   Backend::saveLoginInfo(Backend::getDisplayNameFromUsername(xuser),xde); 
    200  
    201   // We will now fork off, so the child can drop root perms and do its thing 
    202   int pid = fork(); 
    203   if(pid < 0){ 
    204     Backend::log("Error: Could not fork for user permissions"); 
    205     return; 
    206   }else if( pid !=0 ){ 
    207     //Parent (calling) process 
    208     int status; 
    209     sleep(2); 
    210     waitpid(pid,&status,0); //wait for the child (session) to finish 
    211  
    212     // Child is all done, lets close down the pam session and cleanup 
    213     pam_shutdown(); 
    214     exit(0); 
    215   } 
    216    
    217   // Get the users uid/gid information 
    218   struct passwd *pw; 
    219   int uid; 
    220   char *ok; 
    221  
    222   if (!(pw = getpwnam(xuser.toLatin1()))) { 
    223       uid = strtol(xuser.toLatin1(), &ok, 10); 
    224       if (!(pw = getpwuid(uid))) { 
    225           emit InvalidLogin();  //Make sure the GUI knows that it was a failure 
    226           return; 
    227       } 
    228   } 
    229  
    230   if (setgid(pw->pw_gid) < 0) { 
    231       qDebug() << "setgid() failed!"; 
    232       emit InvalidLogin();  //Make sure the GUI knows that it was a failure 
    233       return; 
    234   } 
    235  
    236   // Setup our other groups 
    237   if (initgroups(xuser.toLatin1(), pw->pw_gid) < 0) { 
    238       qDebug() << "initgroups() failed!"; 
    239       emit InvalidLogin();  //Make sure the GUI knows that it was a failure 
    240       setgid(0); 
    241       return; 
    242   }  
    243  
    244   // Lets drop to user privs 
    245   if (setuid(pw->pw_uid) < 0) { 
    246       qDebug() << "setuid() failed!"; 
    247       emit InvalidLogin();  //Make sure the GUI knows that it was a failure 
    248       return; 
    249   } 
    250  
    251   QString cmd; 
    252   // Configure the DE startup command 
    253   //  - Setup to run the user's <home-dir>/.xprofile startup script 
    254   if(QFile::exists(xhome+"/.xprofile")){ 
    255     cmd.append(". "+xhome+"/.xprofile; ");  //make sure to start it in parallel 
    256   } 
    257   //  - Add the DE startup command to the end 
    258   cmd.append("dbus-launch --exit-with-session "+xcmd); 
    259  
    260   // Get the current locale code 
    261   QLocale mylocale; 
    262   QString langCode = mylocale.name(); 
    263    
    264   //Alternate way of starting a process using c library functions 
    265   
    266   //setup the environment variables 
    267   setenv("LOGNAME",xuser.toUtf8(),1); 
    268   setenv("USERNAME",xuser.toUtf8(),1); 
    269   QString pth = QString(getenv("PATH"))+":"+xhome+"/bin"; 
    270   setenv("PATH",pth.toUtf8(),1); 
    271   if(langCode.toLower()=="c"){} 
    272   else if(QString(getenv("MM_CHARSET")).isEmpty() ){ langCode.append("."+QString(getenv("MM_CHARSET"))); } 
    273   else{ langCode.append(".UTF-8"); } 
    274   setenv("LANG",langCode.toUtf8(),1); 
    275   setenv("MAIL",QString("/var/mail/"+xuser).toUtf8(),1); 
    276   setenv("GROUP",xuser.toUtf8(),1); 
    277   setenv("HOME",xhome.toUtf8(),1); 
    278   setenv("SHELL",pw->pw_shell,1); 
    279   setenv("SHLVL","0",1); 
    280   chdir(xhome.toUtf8()); //move to home dir 
    281     
    282   //Now start the process 
    283   system(cmd.toLatin1()); 
    284 } 
    285 */ 
    286    
    287 /*void XProcess::setupDesktop(QString user, QString pwd, QString desktop){ 
    288   //Setup internal variables 
    289   xuser = Backend::getUsernameFromDisplayname(user); 
    290   xpwd = pwd; 
    291   xhome = Backend::getUserHomeDir(xuser); 
    292   xcmd = Backend::getDesktopBinary(desktop); 
    293   xde = desktop; 
    294   //Also check password  validity 
    295   bool ok = pam_checkPW(); 
    296   pam_shutdown(); 
    297   if(ok){ emit ValidLogin(); } 
    298   else{ emit InvalidLogin(); } 
    299 } 
    300   */ 
    301    
    302189 
    303190//Stand-alone function to check a username/password combination for validity 
  • src-qt4/PCDM/src/pcdm-xprocess.h

    rb28c8d9 r72c9698  
    6161   
    6262  private slots: 
    63         void slotCleanup(int, QProcess::ExitStatus); 
     63        void slotCleanup(); 
    6464 
    6565  signals: 
  • src-qt4/PCDM/src/themeStruct.cpp

    rd9b0b9e8 r72c9698  
    9191            items[index].icon = val; //should be [icononly | textonly | textbesideicon | textundericon ] 
    9292        }else if(itemCat == "LOCATION"){ 
    93             val.remove("[").remove("]").simplified(); //remove the brackets 
     93           val = val.remove("[").remove("]").simplified(); //remove the brackets 
    9494            QString x = val.section(",",0,0); 
    9595            QString y = val.section(",",1,1); 
Note: See TracChangeset for help on using the changeset viewer.