Diffstat (limited to 'core/opie-login/passworddialogimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/opie-login/passworddialogimpl.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/opie-login/passworddialogimpl.cpp b/core/opie-login/passworddialogimpl.cpp index d9132e2..3c1b474 100644 --- a/core/opie-login/passworddialogimpl.cpp +++ b/core/opie-login/passworddialogimpl.cpp | |||
@@ -155,25 +155,29 @@ void PasswordDialogImpl::writePassword() { | |||
155 | FILE* file = ::fopen( "/etc/passwd.new", "w" ); | 155 | FILE* file = ::fopen( "/etc/passwd.new", "w" ); |
156 | struct passwd* pass; | 156 | struct passwd* pass; |
157 | while ( (pass = ::getpwent()) != 0l ) { | 157 | while ( (pass = ::getpwent()) != 0l ) { |
158 | /* no shadow password support */ | 158 | /* no shadow password support */ |
159 | if ( pass->pw_uid == 0 ) | 159 | if ( pass->pw_uid == 0 ) |
160 | pass->pw_passwd = password; | 160 | pass->pw_passwd = password; |
161 | 161 | ||
162 | ::putpwent( pass, file ); | 162 | ::putpwent( pass, file ); |
163 | } | 163 | } |
164 | 164 | ||
165 | ::fclose( file ); | 165 | ::fclose( file ); |
166 | ::endpwent(); | 166 | ::endpwent(); |
167 | ::rename("/etc/passwd.new","/etc/passwd" ); | 167 | if (::rename("/etc/passwd.new","/etc/passwd" ) == -1) |
168 | return error( tr("Rename /etc/passwd failed"), | ||
169 | tr("<qt>Renaming /etc/passwd.new to /etc/passwd failed." | ||
170 | "Please check your /etc/passed file, your /etc directory " | ||
171 | "or your filesystem.</qt>") ); | ||
168 | 172 | ||
169 | /* should be done now */ | 173 | /* should be done now */ |
170 | #ifdef OPIE_LOGIN_SHADOW_PW | 174 | #ifdef OPIE_LOGIN_SHADOW_PW |
171 | #error "Can't write Shadow Passwords fixme" | 175 | #error "Can't write Shadow Passwords fixme" |
172 | #endif | 176 | #endif |
173 | } | 177 | } |
174 | 178 | ||
175 | /** | 179 | /** |
176 | * Raise an error. Delete input and set the focus after showing | 180 | * Raise an error. Delete input and set the focus after showing |
177 | * the error to the user | 181 | * the error to the user |
178 | */ | 182 | */ |
179 | void PasswordDialogImpl::error( const QString& caption, const QString& text ) { | 183 | void PasswordDialogImpl::error( const QString& caption, const QString& text ) { |