[gnome-control-center] [about-me] Fix hangs when 'passwd' outputs unexpected answers



commit 51befc44977f5d380d0524553cc9fdcc2cae411b
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Wed Jan 27 11:22:11 2010 +0100

    [about-me] Fix hangs when 'passwd' outputs unexpected answers
    
    When current password is wrong, passwd outputs on Ubuntu 9.10
    passwd: Authentication token manipulation error
    This doesn't correspond to what we're expecting. Add "error" to the list of words we look for to avoid waiting forever.
    
    When pam-cracklib is used, using an existing word prompts 'passwd' to output
    WEAK PASSWORD: it's based on a dictionary word
    Detect "dictionary" too and consider this as meaning "Password is too simple".

 capplets/about-me/gnome-about-me-password.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/capplets/about-me/gnome-about-me-password.c b/capplets/about-me/gnome-about-me-password.c
index 6a10d99..8e16aea 100644
--- a/capplets/about-me/gnome-about-me-password.c
+++ b/capplets/about-me/gnome-about-me-password.c
@@ -452,7 +452,7 @@ io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswordDialog *pdi
 		case PASSWD_STATE_AUTH:
 			/* Passwd is asking for our current password */
 
-			if (is_string_complete (str->str, "assword: ", "failure", "wrong", NULL)) {
+			if (is_string_complete (str->str, "assword: ", "failure", "wrong", "error", NULL)) {
 				/* Which response did we get? */
 				passdlg_set_busy (pdialog, FALSE);
 
@@ -535,7 +535,8 @@ io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswordDialog *pdi
 						   g_strrstr (str->str, "longer") != NULL) {
 						msg = g_strdup (_("The password is too short."));
 					} else if (g_strrstr (str->str, "palindrome") != NULL ||
-						   g_strrstr (str->str, "simple") != NULL) {
+						   g_strrstr (str->str, "simple") != NULL ||
+						   g_strrstr (str->str, "dictionary") != NULL) {
 						msg = g_strdup (_("The password is too simple."));
 					} else if (g_strrstr (str->str, "similar") != NULL ||
 						   g_strrstr (str->str, "wrapped") != NULL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]