-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 ) | |||
74 | } | 74 | } |
75 | if ( ::getuid ( ) != 0 ) // qt doesn't really like SUID and | 75 | /*! |
76 | ::setuid ( 0 ); // messes up things like config files | 76 | * @bug |
77 | 77 | * Qte does not really like being set UID root. This is | |
78 | //struct rlimit rl; | 78 | * largely because we do almost everything on config files |
79 | //::getrlimit ( RLIMIT_NOFILE, &rl ); | 79 | * in root context. So if you even want to use opie-login |
80 | 80 | * you are in for a world of hurt unless someone at least | |
81 | //for ( unsigned int i = 0; i < rl. rlim_cur; i++ ) | 81 | * scrubs the settings area and the PIM apps to make sure that |
82 | // ::close ( i ); | 82 | * they are covered regarding perms and users. |
83 | */ | ||
84 | if ( ::getuid ( ) != 0 ) | ||
85 | ::setuid ( 0 ); | ||
83 | 86 | ||
@@ -96,3 +99,4 @@ int main ( int argc, char **argv ) | |||
96 | QString entry = c.readEntry( "user", "" ); | 99 | QString entry = c.readEntry( "user", "" ); |
97 | if ( !entry.isEmpty() ) autolog = ::strdup( (const char*) entry ); | 100 | if ( !entry.isEmpty() ) |
101 | autolog = ::strdup( (const char*) entry ); | ||
98 | 102 | ||
@@ -109,3 +113,4 @@ int main ( int argc, char **argv ) | |||
109 | 113 | ||
110 | while ( ::waitpid ( child, &status, 0 ) < 0 ) { } | 114 | while ( ::waitpid ( child, &status, 0 ) < 0 ) |
115 | ; | ||
111 | 116 | ||
@@ -182,3 +187,2 @@ int main ( int argc, char **argv ) | |||
182 | if ( autolog && !userExited ) { | 187 | if ( autolog && !userExited ) { |
183 | |||
184 | QWSServer::setDesktopBackground( QImage() ); | 188 | QWSServer::setDesktopBackground( QImage() ); |
@@ -188,3 +192,2 @@ int main ( int argc, char **argv ) | |||
188 | 192 | ||
189 | |||
190 | if ( LoginApplication::changeIdentity ( )) | 193 | if ( LoginApplication::changeIdentity ( )) |
@@ -247,2 +250,3 @@ public: | |||
247 | case 2: | 250 | case 2: |
251 | default: | ||
248 | // We're going to suspend the whole machine | 252 | // We're going to suspend the whole machine |
@@ -257,4 +261,2 @@ public: | |||
257 | 261 | ||
258 | private: | ||
259 | public: | ||
260 | void setIntervals( int i1 = 30, int i2 = 20, int i3 = 60 ) | 262 | void setIntervals( int i1 = 30, int i2 = 20, int i3 = 60 ) |
@@ -291,2 +293,3 @@ public: | |||
291 | return ; | 293 | return ; |
294 | |||
292 | if ( bright == -2 ) { | 295 | if ( bright == -2 ) { |
@@ -307,3 +310,2 @@ private: | |||
307 | bool m_lcd_status; | 310 | bool m_lcd_status; |
308 | |||
309 | int m_backlight_bright; | 311 | int m_backlight_bright; |
@@ -322,3 +324,4 @@ int login_main ( int argc, char **argv, pid_t ppid ) | |||
322 | if ( QWSServer::mouseHandler() && | 324 | if ( QWSServer::mouseHandler() && |
323 | QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { | 325 | QWSServer::mouseHandler()-> inherits("QCalibratedMouseHandler") ) |
326 | { | ||
324 | if ( !QFile::exists ( "/etc/pointercal" )) { | 327 | if ( !QFile::exists ( "/etc/pointercal" )) { |
@@ -337,6 +340,6 @@ int login_main ( int argc, char **argv, pid_t ppid ) | |||
337 | 340 | ||
338 | |||
339 | LoginWindowImpl *lw = new LoginWindowImpl ( ); | 341 | LoginWindowImpl *lw = new LoginWindowImpl ( ); |
340 | app-> setMainWidget ( lw ); | 342 | app-> setMainWidget ( lw ); |
341 | lw-> setGeometry ( 0, 0, app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); | 343 | lw-> setGeometry ( 0, 0, app-> desktop ( )-> width ( ), |
344 | app-> desktop ( )-> height ( )); | ||
342 | lw-> show ( ); | 345 | lw-> show ( ); |
@@ -348,6 +351,5 @@ int login_main ( int argc, char **argv, pid_t ppid ) | |||
348 | app-> login ( ); | 351 | app-> login ( ); |
349 | |||
350 | // if login succeeds, it never comes back | 352 | // if login succeeds, it never comes back |
351 | 353 | QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), | |
352 | QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start Opie." )); | 354 | LoginWindowImpl::tr( "Could not start Opie." )); |
353 | rc = 1; | 355 | rc = 1; |
@@ -355,6 +357,6 @@ int login_main ( int argc, char **argv, pid_t ppid ) | |||
355 | else { | 357 | else { |
356 | QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not switch to new user identity" )); | 358 | QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), |
359 | LoginWindowImpl::tr( "Could not switch to new user identity" )); | ||
357 | rc = 2; | 360 | rc = 2; |
358 | } | 361 | } |
359 | |||
360 | } | 362 | } |