[gnome-control-center] users: Don't ask for the old password when none is set
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] users: Don't ask for the old password when none is set
- Date: Mon, 24 Sep 2012 19:50:53 +0000 (UTC)
commit a80b3d75c501a08acbbd97406bd21d2926c72b42
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Sep 22 14:08:29 2012 -0400
users: Don't ask for the old password when none is set
This prevents passwordless users (common on live cd setups) from
setting a password.
https://bugzilla.gnome.org/show_bug.cgi?id=684492
panels/user-accounts/um-password-dialog.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/panels/user-accounts/um-password-dialog.c b/panels/user-accounts/um-password-dialog.c
index 8586254..65ac67a 100644
--- a/panels/user-accounts/um-password-dialog.c
+++ b/panels/user-accounts/um-password-dialog.c
@@ -658,12 +658,10 @@ um_password_dialog_set_user (UmPasswordDialog *um,
gtk_entry_set_text (GTK_ENTRY (um->normal_hint_entry), "");
gtk_entry_set_text (GTK_ENTRY (um->old_password_entry), "");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (um->show_password_button), FALSE);
- if (um_user_get_uid (um->user) == getuid()) {
+ if (um_user_get_uid (um->user) == getuid () &&
+ um_user_get_password_mode (um->user) == UM_PASSWORD_MODE_REGULAR) {
gtk_widget_show (um->old_password_label);
gtk_widget_show (um->old_password_entry);
- if (um->passwd_handler != NULL)
- passwd_destroy (um->passwd_handler);
- um->passwd_handler = passwd_init ();
um->old_password_ok = FALSE;
}
else {
@@ -671,6 +669,11 @@ um_password_dialog_set_user (UmPasswordDialog *um,
gtk_widget_hide (um->old_password_entry);
um->old_password_ok = TRUE;
}
+ if (um_user_get_uid (um->user) == getuid()) {
+ if (um->passwd_handler != NULL)
+ passwd_destroy (um->passwd_handler);
+ um->passwd_handler = passwd_init ();
+ }
}
model = gtk_combo_box_get_model (GTK_COMBO_BOX (um->action_combo));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]