author | zecke <zecke> | 2004-07-10 12:40:06 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-07-10 12:40:06 (UTC) |
commit | e18cb7bddb3461a40ae1e8810ef408ceef101d38 (patch) (side-by-side diff) | |
tree | dd5a6b1607f3d2a331c484f07b7dd367ee00f24d | |
parent | 38152afc18715fefc238040ff806d1e3a93e021e (diff) | |
download | opie-e18cb7bddb3461a40ae1e8810ef408ceef101d38.zip opie-e18cb7bddb3461a40ae1e8810ef408ceef101d38.tar.gz opie-e18cb7bddb3461a40ae1e8810ef408ceef101d38.tar.bz2 |
On OE '*' is not for shadow passwords but is a hint that we
could set the password. So use this hint
-rw-r--r-- | core/opie-login/passworddialogimpl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/opie-login/passworddialogimpl.cpp b/core/opie-login/passworddialogimpl.cpp index 951c4e1..852708e 100644 --- a/core/opie-login/passworddialogimpl.cpp +++ b/core/opie-login/passworddialogimpl.cpp @@ -182,50 +182,51 @@ void PasswordDialogImpl::error( const QString& caption, const QString& text ) { m_confirm->setText(""); } void PasswordDialogImpl::slotToggleEcho( bool b ) { m_pass-> setEchoMode( b ? QLineEdit::Normal : QLineEdit::Password ); m_confirm->setEchoMode( b ? QLineEdit::Normal : QLineEdit::Password ); } ///////////////////////// /// static functions /// /** * Ask whether or not we need to show the dialog. It returns true if * no root password is set so that the user will be able to set one. */ bool PasswordDialogImpl::needDialog() { /* * This can cope with no password and shadow passwords * Let us go through the user database until we find 'root' and then * see if it is 'shadow' and see if shadow is empty or see if the password is empty */ bool need = false; struct passwd *pwd; ::setpwent(); while((pwd = ::getpwent() ) ) { /* found root */ if( pwd->pw_uid == 0 ) { QString str = QString::fromLatin1(pwd->pw_passwd ); /* - * If str is really empty it is passwordless anyway... + * If str is really empty it is passwordless anyway... or '*' is a hint to set one + * on OE/Familiar * else it is shadow based */ - if(str.isEmpty() ) + if(str.isEmpty() || str == '*' ) need = true; - else if ( str == '*' || str == 'x' ) + else if ( str == 'x' ) #ifdef OPIE_LOGIN_SHADOW_PW need = QString::fromLatin1( ::getspnam( pwd->pw_name )->sp_pwdp ).isEmpty(); #else ; #endif break; } } ::endpwent(); return need; } |