[gnome-system-tools] Handle two new error messages from 'passwd'



commit 106a3f9617e17d60edc55f600b8247e5fc368c1b
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Sun Jun 27 13:04:19 2010 +0200

    Handle two new error messages from 'passwd'
    
    Don't hang hhen new value for password has been used too
    recently, or when 'passwd' says "simplistic" instead of "simple".
    
    Thanks to Bin Li for the original patches against gnome-about-me.

 src/users/run-passwd.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/users/run-passwd.c b/src/users/run-passwd.c
index 3a6ae51..461d7e0 100644
--- a/src/users/run-passwd.c
+++ b/src/users/run-passwd.c
@@ -462,11 +462,13 @@ io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswdHandler *pass
 			                        "palindrome",
 			                        "dictionary",
 			                        "simple",
+			                        "simplistic",
 			                        "similar",
 			                        "different",
 			                        "case",
 			                        "wrapped",
 			                        "recovered",
+			                        "recent",
 			                        "unchanged",
 			                        "match",
 			                        "1 numeric or special",
@@ -496,6 +498,7 @@ io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswdHandler *pass
 						                     _("The new password is too short"));
 					} else if (g_strrstr (str->str, "palindrome") != NULL ||
 						   g_strrstr (str->str, "simple") != NULL ||
+						   g_strrstr (str->str, "simplistic") != NULL ||
 						   g_strrstr (str->str, "dictionary") != NULL) {
 						error = g_error_new (PASSWD_ERROR, PASSWD_ERROR_REJECTED,
 						                     _("The new password is too simple"));
@@ -512,6 +515,9 @@ io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswdHandler *pass
 						   g_strrstr (str->str, "match") != NULL) {
 						error = g_error_new (PASSWD_ERROR, PASSWD_ERROR_REJECTED,
 						                     _("The old and new passwords are the same"));
+					} else if (g_strrstr (str->str, "recent") != NULL) {
+						error = g_error_new (PASSWD_ERROR, PASSWD_ERROR_REJECTED,
+						                     _("The new password has already been used recently."));
 					} else if (g_strrstr (str->str, "failure") != NULL) {
 						/* Authentication failure */
 						error = g_error_new (PASSWD_ERROR, PASSWD_ERROR_AUTH_FAILED,



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