mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
passwd: Do not allow empty passwords
The user should use the delete flag when wanting to issue an empty password. passwd should return an error after receiving empty input.
This commit is contained in:
parent
1a9d0dee2c
commit
c62804df46
1 changed files with 6 additions and 0 deletions
|
@ -110,6 +110,12 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (new_password.value().is_empty() && new_password_retype.value().is_empty()) {
|
||||
warnln("No password supplied.");
|
||||
warnln("Password for user {} unchanged.", target_account.username());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (new_password.value() != new_password_retype.value()) {
|
||||
warnln("Sorry, passwords don't match.");
|
||||
warnln("Password for user {} unchanged.", target_account.username());
|
||||
|
|
Loading…
Add table
Reference in a new issue