-rw-r--r-- | core/opie-login/main.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp index 3f1077c..b76d2c7 100644 --- a/core/opie-login/main.cpp +++ b/core/opie-login/main.cpp @@ -74,10 +74,13 @@ int main ( int argc, char **argv ) } - if ( ::getuid ( ) != 0 ) // qt doesn't really like SUID and - ::setuid ( 0 ); // messes up things like config files - -// struct rlimit rl; -// ::getrlimit ( RLIMIT_NOFILE, &rl ); - -// for ( unsigned int i = 0; i < rl. rlim_cur; i++ ) -// ::close ( i ); + /*! + * @bug + * Qte does not really like being set UID root. This is + * largely because we do almost everything on config files + * in root context. So if you even want to use opie-login + * you are in for a world of hurt unless someone at least + * scrubs the settings area and the PIM apps to make sure that + * they are covered regarding perms and users. + */ + if ( ::getuid ( ) != 0 ) + ::setuid ( 0 ); @@ -96,3 +99,4 @@ int main ( int argc, char **argv ) QString entry = c.readEntry( "user", "" ); - if ( !entry.isEmpty() ) autolog = ::strdup( (const char*) entry ); + if ( !entry.isEmpty() ) + autolog = ::strdup( (const char*) entry ); @@ -109,3 +113,4 @@ int main ( int argc, char **argv ) - while ( ::waitpid ( child, &status, 0 ) < 0 ) { } + while ( ::waitpid ( child, &status, 0 ) < 0 ) + ; @@ -182,3 +187,2 @@ int main ( int argc, char **argv ) if ( autolog && !userExited ) { - QWSServer::setDesktopBackground( QImage() ); @@ -188,3 +192,2 @@ int main ( int argc, char **argv ) - if ( LoginApplication::changeIdentity ( )) @@ -247,2 +250,3 @@ public: case 2: + default: // We're going to suspend the whole machine @@ -257,4 +261,2 @@ public: -private: -public: void setIntervals( int i1 = 30, int i2 = 20, int i3 = 60 ) @@ -291,2 +293,3 @@ public: return ; + if ( bright == -2 ) { @@ -307,3 +310,2 @@ private: bool m_lcd_status; - int m_backlight_bright; @@ -322,3 +324,4 @@ int login_main ( int argc, char **argv, pid_t ppid ) if ( QWSServer::mouseHandler() && - QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { + QWSServer::mouseHandler()-> inherits("QCalibratedMouseHandler") ) + { if ( !QFile::exists ( "/etc/pointercal" )) { @@ -337,6 +340,6 @@ int login_main ( int argc, char **argv, pid_t ppid ) - LoginWindowImpl *lw = new LoginWindowImpl ( ); app-> setMainWidget ( lw ); - lw-> setGeometry ( 0, 0, app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); + lw-> setGeometry ( 0, 0, app-> desktop ( )-> width ( ), + app-> desktop ( )-> height ( )); lw-> show ( ); @@ -348,6 +351,5 @@ int login_main ( int argc, char **argv, pid_t ppid ) app-> login ( ); - // if login succeeds, it never comes back - - QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start Opie." )); + QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), + LoginWindowImpl::tr( "Could not start Opie." )); rc = 1; @@ -355,6 +357,6 @@ int login_main ( int argc, char **argv, pid_t ppid ) else { - QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not switch to new user identity" )); + QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), + LoginWindowImpl::tr( "Could not switch to new user identity" )); rc = 2; } - } |