diff options
author | Milan Bouchet-Valat <nalimilan@club.fr> | 2010-01-27 11:22:11 +0100 |
---|---|---|
committer | Milan Bouchet-Valat <nalimilan@club.fr> | 2010-01-27 11:52:39 +0100 |
commit | 51befc44977f5d380d0524553cc9fdcc2cae411b (patch) | |
tree | cf894d300f37fecbf9ca152cd355ddce2b5b3e82 | |
parent | 932c59a8c6488c54891e4f3da88e94d872842ef4 (diff) | |
download | gnome-control-center-51befc44977f5d380d0524553cc9fdcc2cae411b.tar.gz |
[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".
-rw-r--r-- | 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 6a10d99f9..8e16aead7 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) { |