[PATCH 3/4] 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"));
-- 
1.6.3.3


--=-WTqUhcpzJGUML/4aDgUX
Content-Disposition: attachment; filename="0003-Force-updating-groups-when-showing-groups-dialog.patch"
Content-Type: text/x-patch; name="0003-Force-updating-groups-when-showing-groups-dialog.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit



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