[gnome-system-tools] Don't hang when new and old password only differ in case



commit 2cd869fc59bb9b7d9e6ca6b5329fe76373324763
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Tue Mar 23 12:39:13 2010 +0100

    Don't hang when new and old password only differ in case
    
    'passwd' returns an error when the new and the old passwords only differ in case. If we don't handle this (unlikely) case, users-admin hangs. Assimilate this error to "passwords are too similar".

 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 11a63be..162a747 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",
+			                        "case",
 			                        "wrapped",
 			                        "recovered",
 			                        "unchanged",
@@ -498,6 +499,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, "case") != NULL ||
 						   g_strrstr (str->str, "wrapped") != NULL) {
 						error = g_error_new (PASSWD_ERROR, PASSWD_ERROR_REJECTED,
 						                     _("The old and new passwords are too similar"));



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