]> git.sur5r.net Git - openldap/commitdiff
ITS#4741 fix error check from external password quality module
authorHoward Chu <hyc@openldap.org>
Thu, 9 Nov 2006 04:06:37 +0000 (04:06 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 9 Nov 2006 04:06:37 +0000 (04:06 +0000)
servers/slapd/overlays/ppolicy.c

index 68216d445ae635ab4a570c5d5a3f139d18ede91f..ad2032409bb9fef0d99201e81480341c7d839a39 100644 (file)
@@ -645,13 +645,12 @@ check_password_quality( struct berval *cred, PassPolicy *pp, LDAPPasswordPolicyE
                                ldap_pvt_thread_mutex_lock( &chk_syntax_mutex );
                                ok = prog( cred->bv_val, &txt, e );
                                ldap_pvt_thread_mutex_unlock( &chk_syntax_mutex );
-                               if (txt) {
+                               if (ok != LDAP_SUCCESS) {
                                        Debug(LDAP_DEBUG_ANY,
                                                "check_password_quality: module error: (%s) %s.[%d]\n",
-                                               pp->pwdCheckModule, txt, ok );
+                                               pp->pwdCheckModule, txt ? txt : "", ok );
                                        free(txt);
-                               } else
-                                       ok = LDAP_SUCCESS;
+                               }
                        }
                            
                        lt_dlclose( mod );