[gnome-system-tools/gnome-2-30] Don't hang when new and old password are too similar



commit 841b37ec6edfd6fbc5dd626ca859179c071fc09b
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Sat May 22 12:02:38 2010 +0200

    Don't hang when new and old password are too similar
    
    If new password is really close to the old one, 'passwd' says: "Bad: new password must be different than the old one". Handle this case too, instead of hanging.

 src/users/run-passwd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/users/run-passwd.c b/src/users/run-passwd.c
index 162a747..3a6ae51 100644
--- a/src/users/run-passwd.c
+++ b/src/users/run-passwd.c
@@ -463,6 +463,7 @@ io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswdHandler *pass
 			                        "dictionary",
 			                        "simple",
 			                        "similar",
+			                        "different",
 			                        "case",
 			                        "wrapped",
 			                        "recovered",
@@ -499,6 +500,7 @@ io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswdHandler *pass
 						error = g_error_new (PASSWD_ERROR, PASSWD_ERROR_REJECTED,
 						                     _("The new password is too simple"));
 					} else if (g_strrstr (str->str, "similar") != NULL ||
+					           g_strrstr (str->str, "different") != NULL ||
 					           g_strrstr (str->str, "case") != NULL ||
 						   g_strrstr (str->str, "wrapped") != NULL) {
 						error = g_error_new (PASSWD_ERROR, PASSWD_ERROR_REJECTED,



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