Diffstat (limited to 'core/opie-login/loginwindowimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/opie-login/loginwindowimpl.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/core/opie-login/loginwindowimpl.cpp b/core/opie-login/loginwindowimpl.cpp index 3265b46..f24ebb3 100644 --- a/core/opie-login/loginwindowimpl.cpp +++ b/core/opie-login/loginwindowimpl.cpp | |||
@@ -1,323 +1,323 @@ | |||
1 | #include <qapplication.h> | 1 | #include <qapplication.h> |
2 | #include <qpushbutton.h> | 2 | #include <qpushbutton.h> |
3 | #include <qlayout.h> | 3 | #include <qlayout.h> |
4 | #include <qframe.h> | 4 | #include <qframe.h> |
5 | #include <qlineedit.h> | 5 | #include <qlineedit.h> |
6 | #include <qtimer.h> | 6 | #include <qtimer.h> |
7 | #include <qcombobox.h> | 7 | #include <qcombobox.h> |
8 | #include <qpixmap.h> | 8 | #include <qpixmap.h> |
9 | #include <qlabel.h> | 9 | #include <qlabel.h> |
10 | #include <qpopupmenu.h> | 10 | #include <qpopupmenu.h> |
11 | #include <qmessagebox.h> | 11 | #include <qmessagebox.h> |
12 | 12 | ||
13 | #include <qpe/qcopenvelope_qws.h> | 13 | #include <qpe/qcopenvelope_qws.h> |
14 | 14 | ||
15 | #include <opie/odevice.h> | 15 | #include <opie/odevice.h> |
16 | 16 | ||
17 | #include <stdio.h> | 17 | #include <stdio.h> |
18 | 18 | ||
19 | #include <pwd.h> | 19 | #include <pwd.h> |
20 | #include <grp.h> | 20 | #include <grp.h> |
21 | #include <unistd.h> | 21 | #include <unistd.h> |
22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
23 | #include <signal.h> | ||
23 | 24 | ||
24 | #ifdef USEPAM | 25 | #ifdef USEPAM |
25 | extern "C" { | 26 | extern "C" { |
26 | #include <security/pam_appl.h> | 27 | #include <security/pam_appl.h> |
27 | } | 28 | } |
28 | #else | 29 | #else |
29 | #include <crypt.h> | 30 | #include <crypt.h> |
30 | #include <shadow.h> | 31 | #include <shadow.h> |
31 | #endif | 32 | #endif |
32 | 33 | ||
33 | #include "loginwindowimpl.h" | 34 | #include "loginwindowimpl.h" |
34 | #include "inputmethods.h" | 35 | #include "inputmethods.h" |
35 | 36 | ||
36 | LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_Customize | WStyle_NoBorder | WDestructiveClose ) | 37 | LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_Customize | WStyle_NoBorder | WDestructiveClose ) |
37 | { | 38 | { |
38 | QPopupMenu *pop = new QPopupMenu ( this ); | 39 | QPopupMenu *pop = new QPopupMenu ( this ); |
39 | pop-> insertItem ( tr( "Restart" ), this, SLOT( restart ( ))); | 40 | pop-> insertItem ( tr( "Restart" ), this, SLOT( restart ( ))); |
41 | pop-> insertItem ( tr( "Quit" ), this, SLOT( quit ( ))); | ||
40 | m_menu-> setPopup ( pop ); | 42 | m_menu-> setPopup ( pop ); |
41 | 43 | ||
42 | QHBoxLayout *lay = new QHBoxLayout ( m_taskbar, 4, 4 ); | 44 | QHBoxLayout *lay = new QHBoxLayout ( m_taskbar, 4, 4 ); |
43 | m_input = new InputMethods ( m_taskbar ); | 45 | m_input = new InputMethods ( m_taskbar ); |
44 | lay-> addWidget ( m_input ); | 46 | lay-> addWidget ( m_input ); |
45 | lay-> addStretch ( 10 ); | 47 | lay-> addStretch ( 10 ); |
46 | 48 | ||
47 | setActiveWindow ( ); | 49 | setActiveWindow ( ); |
48 | m_password-> setFocus ( ); | 50 | m_password-> setFocus ( ); |
49 | 51 | ||
50 | m_user-> insertStringList ( getAllUsers ( )); | 52 | m_user-> insertStringList ( getAllUsers ( )); |
51 | 53 | ||
52 | QTimer::singleShot ( 0, this, SLOT( showIM ( ))); | 54 | QTimer::singleShot ( 0, this, SLOT( showIM ( ))); |
53 | 55 | ||
54 | QString opiedir = ::getenv ( "OPIEDIR" ); | 56 | QString opiedir = ::getenv ( "OPIEDIR" ); |
55 | QPixmap bgpix ( opiedir + "/pics/launcher/opie-background.jpg" ); | 57 | QPixmap bgpix ( opiedir + "/pics/launcher/opie-background.jpg" ); |
56 | 58 | ||
57 | if ( !bgpix. isNull ( )) | 59 | if ( !bgpix. isNull ( )) |
58 | setBackgroundPixmap ( bgpix ); | 60 | setBackgroundPixmap ( bgpix ); |
59 | 61 | ||
60 | m_caption-> setText ( m_caption-> text ( ) + tr( "<center><h1><u>%1 %2</u></h1></center>" ). arg ( ODevice::inst ( )-> systemString ( )). arg ( ODevice::inst ( )-> systemVersionString ( ))); | 62 | m_caption-> setText ( m_caption-> text ( ) + tr( "<center>%1 %2</center>" ). arg ( ODevice::inst ( )-> systemString ( )). arg ( ODevice::inst ( )-> systemVersionString ( ))); |
61 | } | 63 | } |
62 | 64 | ||
63 | LoginWindowImpl::~LoginWindowImpl ( ) | 65 | LoginWindowImpl::~LoginWindowImpl ( ) |
64 | { | 66 | { |
65 | } | 67 | } |
66 | 68 | ||
67 | void LoginWindowImpl::keyPressEvent ( QKeyEvent *e ) | 69 | void LoginWindowImpl::keyPressEvent ( QKeyEvent *e ) |
68 | { | 70 | { |
69 | switch ( e-> key ( )) { | 71 | switch ( e-> key ( )) { |
70 | case Key_F34: suspend ( ); | 72 | case HardKey_Suspend: suspend ( ); |
71 | break; | 73 | break; |
72 | case Key_F35: backlight ( ); | 74 | case HardKey_Backlight: backlight ( ); |
73 | break; | 75 | break; |
74 | default : e-> ignore ( ); | 76 | default: e-> ignore ( ); |
75 | break; | 77 | break; |
76 | } | 78 | } |
77 | LoginWindow::keyPressEvent ( e ); | 79 | LoginWindow::keyPressEvent ( e ); |
78 | } | 80 | } |
79 | 81 | ||
80 | 82 | ||
81 | void LoginWindowImpl::toggleEchoMode ( bool t ) | 83 | void LoginWindowImpl::toggleEchoMode ( bool t ) |
82 | { | 84 | { |
83 | m_password-> setEchoMode ( t ? QLineEdit::Normal : QLineEdit::Password ); | 85 | m_password-> setEchoMode ( t ? QLineEdit::Normal : QLineEdit::Password ); |
84 | } | 86 | } |
85 | 87 | ||
86 | QStringList LoginWindowImpl::getAllUsers ( ) | 88 | QStringList LoginWindowImpl::getAllUsers ( ) |
87 | { | 89 | { |
88 | struct passwd *pwd; | 90 | struct passwd *pwd; |
89 | QStringList sl; | 91 | QStringList sl; |
90 | 92 | ||
91 | while (( pwd = getpwent ( ))) { | 93 | while (( pwd = ::getpwent ( ))) { |
92 | if (( pwd-> pw_uid == 0 ) || ( pwd-> pw_uid >= 500 && pwd-> pw_uid < 65534 )) | 94 | if (( pwd-> pw_uid == 0 ) || ( pwd-> pw_uid >= 500 && pwd-> pw_uid < 65534 )) |
93 | sl << QString ( pwd-> pw_name ); | 95 | sl << QString ( pwd-> pw_name ); |
94 | } | 96 | } |
95 | 97 | ||
96 | endpwent ( ); | 98 | ::endpwent ( ); |
97 | 99 | ||
98 | return sl; | 100 | return sl; |
99 | } | 101 | } |
100 | 102 | ||
101 | void LoginWindowImpl::showIM ( ) | 103 | void LoginWindowImpl::showIM ( ) |
102 | { | 104 | { |
103 | m_input-> showInputMethod ( ); | 105 | m_input-> showInputMethod ( ); |
104 | } | 106 | } |
105 | 107 | ||
106 | void LoginWindowImpl::restart ( ) | 108 | void LoginWindowImpl::restart ( ) |
107 | { | 109 | { |
108 | qApp-> quit ( ); | 110 | qApp-> quit ( ); |
109 | } | 111 | } |
110 | 112 | ||
113 | void LoginWindowImpl::quit ( ) | ||
114 | { | ||
115 | qApp-> quit ( ); | ||
116 | ::kill ( ::getppid ( ), SIGUSR1 ); | ||
117 | } | ||
118 | |||
111 | void LoginWindowImpl::suspend ( ) | 119 | void LoginWindowImpl::suspend ( ) |
112 | { | 120 | { |
113 | system ( "apm -s" ); | 121 | ODevice::inst ( )-> suspend ( ); |
114 | usleep ( 1 * 1000 * 1000 ); | 122 | |
115 | { | 123 | QCopEnvelope e("QPE/System", "setBacklight(int)"); |
116 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | 124 | e << -3; // Force on |
117 | e << -3; // Force on | ||
118 | } | ||
119 | } | 125 | } |
120 | 126 | ||
121 | void LoginWindowImpl::backlight ( ) | 127 | void LoginWindowImpl::backlight ( ) |
122 | { | 128 | { |
123 | { | 129 | QCopEnvelope e("QPE/System", "setBacklight(int)"); |
124 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | 130 | e << -2; // toggle |
125 | e << -2; // toggle | ||
126 | } | ||
127 | } | 131 | } |
128 | 132 | ||
129 | #ifdef USEPAM | 133 | #ifdef USEPAM |
130 | 134 | ||
131 | static const char *_PAM_SERVICE = "xdm"; | 135 | static const char *_PAM_SERVICE = "xdm"; |
132 | static const char *PAM_password; | 136 | static const char *PAM_password; |
133 | 137 | ||
134 | typedef const struct pam_message pam_message_type; | 138 | typedef const struct pam_message pam_message_type; |
135 | 139 | ||
136 | static int PAM_conv( int, pam_message_type **, struct pam_response **, void * ); | 140 | static int PAM_conv( int, pam_message_type **, struct pam_response **, void * ); |
137 | 141 | ||
138 | static struct pam_conv PAM_conversation = { | 142 | static struct pam_conv PAM_conversation = { |
139 | &PAM_conv, | 143 | &PAM_conv, |
140 | NULL | 144 | NULL |
141 | }; | 145 | }; |
142 | 146 | ||
143 | //---------------------------------------------------------------------------- | 147 | //---------------------------------------------------------------------------- |
144 | 148 | ||
145 | static char *COPY_STRING( const char * s ) { | 149 | static char *COPY_STRING( const char * s ) { |
146 | return (s) ? strdup(s) : (char *)NULL; | 150 | return (s) ? strdup(s) : (char *)NULL; |
147 | } | 151 | } |
148 | 152 | ||
149 | #define GET_MEM if (reply) realloc(reply, size);\ | 153 | #define GET_MEM if (reply) realloc(reply, size);\ |
150 | else reply = (struct pam_response *)malloc(size); \ | 154 | else reply = (struct pam_response *)malloc(size); \ |
151 | if (!reply) return PAM_CONV_ERR; \ | 155 | if (!reply) return PAM_CONV_ERR; \ |
152 | size += sizeof(struct pam_response) | 156 | size += sizeof(struct pam_response) |
153 | 157 | ||
154 | 158 | ||
155 | static int PAM_conv( int num_msg, pam_message_type **msg, | 159 | static int PAM_conv( int num_msg, pam_message_type **msg, |
156 | struct pam_response **resp, void *) | 160 | struct pam_response **resp, void *) |
157 | { | 161 | { |
158 | int count = 0, replies = 0; | 162 | int count = 0, replies = 0; |
159 | struct pam_response *reply = NULL; | 163 | struct pam_response *reply = NULL; |
160 | int size = sizeof(struct pam_response); | 164 | int size = sizeof(struct pam_response); |
161 | 165 | ||
162 | for( count = 0; count < num_msg; count++ ) { | 166 | for( count = 0; count < num_msg; count++ ) { |
163 | switch (msg[count]->msg_style) { | 167 | switch (msg[count]->msg_style) { |
164 | case PAM_PROMPT_ECHO_ON: | 168 | case PAM_PROMPT_ECHO_ON: |
165 | /* user name given to PAM already */ | 169 | /* user name given to PAM already */ |
166 | return PAM_CONV_ERR; | 170 | return PAM_CONV_ERR; |
167 | 171 | ||
168 | case PAM_PROMPT_ECHO_OFF: | 172 | case PAM_PROMPT_ECHO_OFF: |
169 | /* wants password */ | 173 | /* wants password */ |
170 | GET_MEM; | 174 | GET_MEM; |
171 | reply[replies].resp_retcode = PAM_SUCCESS; | 175 | reply[replies].resp_retcode = PAM_SUCCESS; |
172 | reply[replies].resp = COPY_STRING(PAM_password); | 176 | reply[replies].resp = COPY_STRING(PAM_password); |
173 | replies++; | 177 | replies++; |
174 | /* PAM frees resp */ | 178 | /* PAM frees resp */ |
175 | break; | 179 | break; |
176 | case PAM_TEXT_INFO: | 180 | case PAM_TEXT_INFO: |
177 | break; | 181 | break; |
178 | default: | 182 | default: |
179 | /* unknown or PAM_ERROR_MSG */ | 183 | /* unknown or PAM_ERROR_MSG */ |
180 | if (reply) free (reply); | 184 | if (reply) free (reply); |
181 | return PAM_CONV_ERR; | 185 | return PAM_CONV_ERR; |
182 | } | 186 | } |
183 | } | 187 | } |
184 | if (reply) *resp = reply; | 188 | if (reply) *resp = reply; |
185 | return PAM_SUCCESS; | 189 | return PAM_SUCCESS; |
186 | } | 190 | } |
187 | 191 | ||
188 | 192 | ||
189 | static bool pwcheck_PAM( const char *user, const char *password ) | 193 | static bool pwcheck_PAM( const char *user, const char *password ) |
190 | { | 194 | { |
191 | bool pw_correct = false; | 195 | bool pw_correct = false; |
192 | int pam_error; | 196 | int pam_error; |
193 | int pam_return = 0; | 197 | int pam_return = 0; |
194 | pam_handle_t *pamh = 0; | 198 | pam_handle_t *pamh = 0; |
195 | PAM_password = password; | 199 | PAM_password = password; |
196 | 200 | ||
197 | pam_error = pam_start( _PAM_SERVICE, user, &PAM_conversation, &pamh ); | 201 | pam_error = pam_start( _PAM_SERVICE, user, &PAM_conversation, &pamh ); |
198 | if( pam_error == PAM_SUCCESS ) { | 202 | if( pam_error == PAM_SUCCESS ) { |
199 | pam_error = pam_authenticate( pamh, 0 ); | 203 | pam_error = pam_authenticate( pamh, 0 ); |
200 | if( pam_error == PAM_SUCCESS ) { | 204 | if( pam_error == PAM_SUCCESS ) { |
201 | //-- password correct | 205 | //-- password correct |
202 | pw_correct = true; | 206 | pw_correct = true; |
203 | pam_return = PAM_SUCCESS; | 207 | pam_return = PAM_SUCCESS; |
204 | } else { | 208 | } else { |
205 | pam_return = pam_error; | 209 | pam_return = pam_error; |
206 | } | 210 | } |
207 | } else { | 211 | } else { |
208 | // cerr << "PAM error: " << pam_strerror( pamh, pam_error ) << endl; | 212 | // cerr << "PAM error: " << pam_strerror( pamh, pam_error ) << endl; |
209 | } | 213 | } |
210 | pam_end( pamh, pam_return ); | 214 | pam_end( pamh, pam_return ); |
211 | return pw_correct; | 215 | return pw_correct; |
212 | } | 216 | } |
213 | 217 | ||
214 | #else | 218 | #else |
215 | 219 | ||
216 | //---------------------------------------------------------------------------- | 220 | //---------------------------------------------------------------------------- |
217 | 221 | ||
218 | static bool pwcheck_Unix( const char *user, const char *pass ) | 222 | static bool pwcheck_Unix( const char *user, const char *pass ) |
219 | { | 223 | { |
220 | char *encrypted, *correct; | 224 | char *encrypted, *correct; |
221 | struct passwd *pw; | 225 | struct passwd *pw; |
222 | 226 | ||
223 | if ( !user || !pass ) | 227 | if ( !user || !pass ) |
224 | return false; | 228 | return false; |
225 | 229 | ||
226 | pw = getpwnam ( user ); | 230 | pw = getpwnam ( user ); |
227 | 231 | ||
228 | if ( !pw ) | 232 | if ( !pw ) |
229 | return false; | 233 | return false; |
230 | 234 | ||
231 | if (( strcmp ( pw-> pw_passwd, "x" ) == 0 ) || ( strcmp ( pw-> pw_passwd, "*" ) == 0 )) { | 235 | if (( strcmp ( pw-> pw_passwd, "x" ) == 0 ) || ( strcmp ( pw-> pw_passwd, "*" ) == 0 )) { |
232 | struct spwd *sp = getspnam ( pw-> pw_name ); | 236 | struct spwd *sp = getspnam ( pw-> pw_name ); |
233 | 237 | ||
234 | if ( !sp ) | 238 | if ( !sp ) |
235 | return false; | 239 | return false; |
236 | 240 | ||
237 | correct = sp-> sp_pwdp; | 241 | correct = sp-> sp_pwdp; |
238 | } | 242 | } |
239 | else | 243 | else |
240 | correct = pw-> pw_passwd; | 244 | correct = pw-> pw_passwd; |
241 | 245 | ||
242 | if ( correct == 0 || correct[0] == '\0' ) | 246 | if ( correct == 0 || correct[0] == '\0' ) |
243 | return true; | 247 | return true; |
244 | 248 | ||
245 | encrypted = crypt ( pass, correct ); | 249 | encrypted = crypt ( pass, correct ); |
246 | return ( strcmp ( encrypted, correct ) == 0 ); | 250 | return ( strcmp ( encrypted, correct ) == 0 ); |
247 | } | 251 | } |
248 | 252 | ||
249 | #endif | 253 | #endif |
250 | 254 | ||
251 | 255 | ||
252 | bool LoginWindowImpl::changeIdentity ( const char *user ) | 256 | bool LoginWindowImpl::changeIdentity ( const char *user ) |
253 | { | 257 | { |
254 | const char *DEFAULT_LOGIN_PATH = "/bin:/usr/bin"; | 258 | const char *DEFAULT_LOGIN_PATH = "/bin:/usr/bin"; |
255 | const char *DEFAULT_ROOT_LOGIN_PATH = "/usr/sbin:/bin:/usr/bin:/sbin"; | 259 | const char *DEFAULT_ROOT_LOGIN_PATH = "/usr/sbin:/bin:/usr/bin:/sbin"; |
256 | 260 | ||
257 | bool fail = false; | 261 | bool fail = false; |
258 | struct passwd *pw = getpwnam ( user ); | 262 | struct passwd *pw = getpwnam ( user ); |
259 | 263 | ||
260 | fail |= ( pw == 0 ); | 264 | fail |= ( pw == 0 ); |
261 | printf ( "1 %d\n", fail ); | ||
262 | fail |= ( initgroups ( pw-> pw_name, pw-> pw_gid )); | 265 | fail |= ( initgroups ( pw-> pw_name, pw-> pw_gid )); |
263 | endgrent ( ); | 266 | endgrent ( ); |
264 | printf ( "2 %d\n", fail ); | ||
265 | fail |= ( setgid ( pw-> pw_gid )); | 267 | fail |= ( setgid ( pw-> pw_gid )); |
266 | printf ( "3 %d\n", fail ); | ||
267 | fail |= ( setuid ( pw-> pw_uid )); | 268 | fail |= ( setuid ( pw-> pw_uid )); |
268 | 269 | ||
269 | printf ( "4 %d\n", fail ); | ||
270 | fail |= ( chdir ( pw-> pw_dir ) && chdir ( "/" )); | 270 | fail |= ( chdir ( pw-> pw_dir ) && chdir ( "/" )); |
271 | 271 | ||
272 | printf ( "5 %d\n", fail ); | ||
273 | fail |= ( setenv ( "HOME", pw-> pw_dir, 1 )); | 272 | fail |= ( setenv ( "HOME", pw-> pw_dir, 1 )); |
274 | printf ( "6 %d\n", fail ); | ||
275 | fail |= ( setenv ( "SHELL", pw-> pw_shell, 1 )); | 273 | fail |= ( setenv ( "SHELL", pw-> pw_shell, 1 )); |
276 | printf ( "7 %d\n", fail ); | ||
277 | fail |= ( setenv ( "USER", pw-> pw_name, 1 )); | 274 | fail |= ( setenv ( "USER", pw-> pw_name, 1 )); |
278 | printf ( "8 %d\n", fail ); | ||
279 | fail |= ( setenv ( "LOGNAME", pw-> pw_name, 1 )); | 275 | fail |= ( setenv ( "LOGNAME", pw-> pw_name, 1 )); |
280 | printf ( "9 %d\n", fail ); | ||
281 | fail |= ( setenv ( "PATH", ( pw-> pw_uid ? DEFAULT_LOGIN_PATH : DEFAULT_ROOT_LOGIN_PATH ), 1 )); | 276 | fail |= ( setenv ( "PATH", ( pw-> pw_uid ? DEFAULT_LOGIN_PATH : DEFAULT_ROOT_LOGIN_PATH ), 1 )); |
282 | printf ( "10 %d\n", fail ); | 277 | |
283 | |||
284 | return !fail; | 278 | return !fail; |
285 | } | 279 | } |
286 | 280 | ||
287 | void LoginWindowImpl::login ( ) | 281 | void LoginWindowImpl::login ( ) |
288 | { | 282 | { |
289 | const char *user = strdup ( m_user-> currentText ( ). local8Bit ( )); | 283 | const char *user = ::strdup ( m_user-> currentText ( ). local8Bit ( )); |
290 | const char *pass = strdup ( m_password-> text ( ). local8Bit ( )); | 284 | const char *pass = ::strdup ( m_password-> text ( ). local8Bit ( )); |
291 | bool ok; | 285 | bool ok; |
292 | 286 | ||
293 | if ( !user || !user [0] ) | 287 | if ( !user || !user [0] ) |
294 | return; | 288 | return; |
295 | if ( !pass ) | 289 | if ( !pass ) |
296 | pass = ""; | 290 | pass = ""; |
297 | 291 | ||
298 | #if defined( USEPAM ) | 292 | #if defined( USEPAM ) |
299 | ok = pwcheck_PAM ( user, pass ); | 293 | ok = pwcheck_PAM ( user, pass ); |
300 | #else | 294 | #else |
301 | ok = pwcheck_Unix ( user, pass ); | 295 | ok = pwcheck_Unix ( user, pass ); |
302 | #endif | 296 | #endif |
303 | 297 | ||
304 | if ( ok ) { | 298 | if ( ok ) { |
305 | if ( changeIdentity ( user )) { | 299 | if ( changeIdentity ( user )) { |
306 | QString opie = getenv ( "OPIEDIR" ); | 300 | char *opie = ::getenv ( "OPIEDIR" ); |
307 | opie += "/bin/qpe"; | 301 | char *arg = new char [::strlen ( opie ) + 8 + 1]; |
308 | 302 | ||
309 | execl ( opie. latin1 ( ), "qpe", 0 ); | 303 | ::strcpy ( arg, opie ); |
310 | 304 | ::strcat ( arg, "/bin/qpe" ); | |
311 | QMessageBox::critical ( this, tr( "Failure" ), tr( "Could not start OPIE." )); | 305 | |
306 | // start qpe via a login shell | ||
307 | ::execl ( "/bin/sh", "-sh", "-c", arg, 0 ); | ||
308 | |||
309 | QMessageBox::critical ( this, tr( "Failure" ), tr( "Could not start OPIE\n(%1)." ). arg ( arg )); | ||
310 | delete [] arg; | ||
311 | |||
312 | restart ( ); | 312 | restart ( ); |
313 | } | 313 | } |
314 | else { | 314 | else { |
315 | QMessageBox::critical ( this, tr( "Failure" ), tr( "Could not switch to new user identity" )); | 315 | QMessageBox::critical ( this, tr( "Failure" ), tr( "Could not switch to new user identity" )); |
316 | restart ( ); | 316 | restart ( ); |
317 | } | 317 | } |
318 | } | 318 | } |
319 | else { | 319 | else { |
320 | QMessageBox::warning ( this, tr( "Wrong password" ), tr( "The given password is incorrect." )); | 320 | QMessageBox::warning ( this, tr( "Wrong password" ), tr( "The given password is incorrect." )); |
321 | m_password-> clear ( ); | 321 | m_password-> clear ( ); |
322 | } | 322 | } |
323 | } | 323 | } |