[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".
This commit is contained in:
Milan Bouchet-Valat 2010-01-27 11:22:11 +01:00
parent 932c59a8c6
commit 51befc4497

View file

@ -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) {