Description: Handle the case where passwd re-asks for the current password when it was entered incorrectly (when using LDAP)
 Based on a patch from Ryan Tandy
Author: Chris Coulson <chris.coulson@canonical.com>
Bug-Ubuntu: https:/launchpad.net/bugs/607357
Forwarded: no

Index: gnome-control-center-3.14.4/panels/user-accounts/run-passwd.c
===================================================================
--- gnome-control-center-3.14.4.orig/panels/user-accounts/run-passwd.c	2015-04-27 16:34:03.007787268 +0200
+++ gnome-control-center-3.14.4/panels/user-accounts/run-passwd.c	2015-04-27 16:34:03.003787194 +0200
@@ -404,7 +404,7 @@
 
                         if (is_string_complete (str->str, "assword: ", "failure", "wrong", "error", NULL)) {
 
-                                if (strstr (str->str, "assword: ") != NULL) {
+                                if (strstr (str->str, "assword: ") != NULL && strstr (str->str, "incorrect") == NULL) {
                                         /* Authentication successful */
 
                                         passwd_handler->backend_state = PASSWD_STATE_NEW;
