summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/opie-login/main.cpp29
1 files changed, 8 insertions, 21 deletions
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp
index 711bedc..554efd3 100644
--- a/core/opie-login/main.cpp
+++ b/core/opie-login/main.cpp
@@ -65,8 +65,2 @@ void exit_closelog ( );
65 65
66static struct option long_options [] = {
67 { "autologin", 1, 0, 'a' },
68 { 0, 0, 0, 0 }
69};
70
71
72int main ( int argc, char **argv ) 66int main ( int argc, char **argv )
@@ -77,3 +71,3 @@ int main ( int argc, char **argv )
77 if ( ::geteuid ( ) != 0 ) { 71 if ( ::geteuid ( ) != 0 ) {
78 ::fprintf ( stderr, "%s can only be executed by root. (or chmod +s)", argv [0] ); 72 ::fprintf ( stderr, "%s can only be executed by root. (or chmod +s)\n", argv [0] );
79 return 1; 73 return 1;
@@ -83,15 +77,2 @@ int main ( int argc, char **argv )
83 77
84 char *autolog = 0;
85 int c;
86 while (( c = ::getopt_long ( argc, argv, "a:", long_options, 0 )) != -1 ) {
87 switch ( c ) {
88 case 'a':
89 autolog = optarg;
90 break;
91 default:
92 ::fprintf ( stderr, "Usage: %s [-a|--autologin=<user>]\n", argv [0] );
93 return 2;
94 }
95 }
96
97 //struct rlimit rl; 78 //struct rlimit rl;
@@ -111,2 +92,8 @@ int main ( int argc, char **argv )
111 92
93 const char* autolog = 0;
94 Config c( "opie-login" );
95 c.setGroup( "autologin" );
96 QString entry = c.readEntry( "user", "" );
97 if ( !entry.isEmpty() ) autolog = ::strdup( (const char*) entry );
98
112 while ( true ) { 99 while ( true ) {
@@ -196,3 +183,3 @@ int main ( int argc, char **argv )
196 LoginApplication *app = new LoginApplication ( argc, argv, ppid ); 183 LoginApplication *app = new LoginApplication ( argc, argv, ppid );
197 LoginApplication::setLoginAs ( autolog ); 184 LoginApplication::setLoginAs( autolog );
198 185