[gnome-control-center] user-accounts: Fix password strenght check
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] user-accounts: Fix password strenght check
- Date: Mon, 25 Sep 2017 12:46:36 +0000 (UTC)
commit 51c9a3235b437b453ce0318fa6fece25816d3598
Author: Ondrej Holy <oholy redhat com>
Date: Mon Sep 25 14:23:24 2017 +0200
user-accounts: Fix password strenght check
It is possible to use weak passwords in dialogs currently, which is
not intentional and leads to problems in case of changing password of
current user. This regression was introduced by Bug 780002, which added
new strength level for weak passwords. Let's reflect the new level also
when setting sensitivity...
https://bugzilla.gnome.org/show_bug.cgi?id=788122
panels/user-accounts/um-account-dialog.c | 2 +-
panels/user-accounts/um-password-dialog.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/panels/user-accounts/um-account-dialog.c b/panels/user-accounts/um-account-dialog.c
index 91cba2e..9ca2c6d 100644
--- a/panels/user-accounts/um-account-dialog.c
+++ b/panels/user-accounts/um-account-dialog.c
@@ -327,7 +327,7 @@ local_validate (UmAccountDialog *self)
verify = gtk_entry_get_text (GTK_ENTRY (self->local_verify));
if (self->local_password_mode == ACT_USER_PASSWORD_MODE_REGULAR) {
strength = update_password_strength (self);
- valid_password = strength > 0 && strcmp (password, verify) == 0;
+ valid_password = strength > 1 && strcmp (password, verify) == 0;
} else {
valid_password = TRUE;
}
diff --git a/panels/user-accounts/um-password-dialog.c b/panels/user-accounts/um-password-dialog.c
index 6921b88..0a142ed 100644
--- a/panels/user-accounts/um-password-dialog.c
+++ b/panels/user-accounts/um-password-dialog.c
@@ -230,7 +230,7 @@ update_sensitivity (UmPasswordDialog *um)
if (um->password_mode == ACT_USER_PASSWORD_MODE_REGULAR) {
strength = update_password_strength (um);
- can_change = strength > 0 && strcmp (password, verify) == 0 &&
+ can_change = strength > 1 && strcmp (password, verify) == 0 &&
(um->old_password_ok || !gtk_widget_get_visible (um->old_password_entry));
}
else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]