summaryrefslogtreecommitdiff
path: root/core/opie-login/main.cpp
authorsandman <sandman>2002-12-17 19:41:05 (UTC)
committer sandman <sandman>2002-12-17 19:41:05 (UTC)
commit0e05c298cc4e5a5d509286e31a3a863e78c76456 (patch) (unidiff)
tree2a86553b593ff9690c14e1796c54c707f189fdf3 /core/opie-login/main.cpp
parent98f90f6ed89986485a1413c4325411e30f4c0693 (diff)
downloadopie-0e05c298cc4e5a5d509286e31a3a863e78c76456.zip
opie-0e05c298cc4e5a5d509286e31a3a863e78c76456.tar.gz
opie-0e05c298cc4e5a5d509286e31a3a863e78c76456.tar.bz2
Opie login becomes useable now:
- pre- and post-session scripts (in $OPIEDIR/share/opie-login) to fix things like device ownership to user/root - logging in now doesn't simply mean: execute bin/qpe. instead opie-login * first tries to execute ~/.opie-session * if that doesn't exist $OPIEDIR/share/opie-login/opie-session * if that fails too, execute $OPIEDIR/bin/qpe you can now handle things like ssh-agent on a per-user basis. (I'll commit the scripts later - for now it simply works like before)
Diffstat (limited to 'core/opie-login/main.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/opie-login/main.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp
index 674829d..81f4d1e 100644
--- a/core/opie-login/main.cpp
+++ b/core/opie-login/main.cpp
@@ -62,6 +62,7 @@ using namespace Opie;
62 62
63int login_main ( int argc, char **argv, pid_t ppid ); 63int login_main ( int argc, char **argv, pid_t ppid );
64void sigterm ( int sig ); 64void sigterm ( int sig );
65void sigint ( int sig );
65void exit_closelog ( ); 66void exit_closelog ( );
66 67
67static struct option long_options [] = { 68static struct option long_options [] = {
@@ -74,7 +75,6 @@ int main ( int argc, char **argv )
74{ 75{
75 pid_t ppid = ::getpid ( ); 76 pid_t ppid = ::getpid ( );
76 77
77
78 if ( ::geteuid ( ) != 0 ) { 78 if ( ::geteuid ( ) != 0 ) {
79 ::fprintf ( stderr, "%s can only be executed by root. (or chmod +s)", argv [0] ); 79 ::fprintf ( stderr, "%s can only be executed by root. (or chmod +s)", argv [0] );
80 return 1; 80 return 1;
@@ -104,7 +104,8 @@ int main ( int argc, char **argv )
104 ::setpgid ( 0, 0 ); 104 ::setpgid ( 0, 0 );
105 ::setsid ( ); 105 ::setsid ( );
106 106
107 ::signal ( SIGTERM, sigterm ); 107 ::signal ( SIGTERM, sigterm );
108 ::signal ( SIGINT, sigterm );
108 109
109 ::openlog ( "opie-login", LOG_CONS, LOG_AUTHPRIV ); 110 ::openlog ( "opie-login", LOG_CONS, LOG_AUTHPRIV );
110 ::atexit ( exit_closelog ); 111 ::atexit ( exit_closelog );
@@ -122,6 +123,8 @@ int main ( int argc, char **argv )
122 123
123 while ( ::waitpid ( child, &status, 0 ) < 0 ) { } 124 while ( ::waitpid ( child, &status, 0 ) < 0 ) { }
124 125
126 LoginApplication::logout ( );
127
125 if (( ::time ( 0 ) - started ) < 3 ) { 128 if (( ::time ( 0 ) - started ) < 3 ) {
126 if ( autolog ) { 129 if ( autolog ) {
127 ::syslog ( LOG_ERR, "Respawning too fast -- disabling auto-login\n" ); 130 ::syslog ( LOG_ERR, "Respawning too fast -- disabling auto-login\n" );
@@ -148,6 +151,8 @@ int main ( int argc, char **argv )
148 } 151 }
149 if ( killedbysig ) { // qpe was killed by an uncaught signal 152 if ( killedbysig ) { // qpe was killed by an uncaught signal
150 qApp = 0; 153 qApp = 0;
154
155 ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig );
151 156
152 QWSServer::setDesktopBackground ( QImage ( )); 157 QWSServer::setDesktopBackground ( QImage ( ));
153 QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer ); 158 QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer );
@@ -303,6 +308,7 @@ private:
303}; 308};
304 309
305 310
311namespace Opie { extern int force_appearance; } // HACK to get around the force-style setting
306 312
307 313
308int login_main ( int argc, char **argv, pid_t ppid ) 314int login_main ( int argc, char **argv, pid_t ppid )
@@ -310,6 +316,8 @@ int login_main ( int argc, char **argv, pid_t ppid )
310 QWSServer::setDesktopBackground( QImage() ); 316 QWSServer::setDesktopBackground( QImage() );
311 LoginApplication *app = new LoginApplication ( argc, argv, ppid ); 317 LoginApplication *app = new LoginApplication ( argc, argv, ppid );
312 318
319 Opie::force_appearance = 0;
320
313 app-> setFont ( QFont ( "Helvetica", 10 )); 321 app-> setFont ( QFont ( "Helvetica", 10 ));
314 app-> setStyle ( new QPEStyle ( )); 322 app-> setStyle ( new QPEStyle ( ));
315 323