]> git.sur5r.net Git - openldap/commitdiff
Fix check_password with {cleartext} passwords
authorHoward Chu <hyc@openldap.org>
Tue, 30 Jun 2009 11:24:11 +0000 (11:24 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 30 Jun 2009 11:24:11 +0000 (11:24 +0000)
servers/slapd/overlays/ppolicy.c

index 62324ca2f9d9958fbad9ff943decdd7154cc7c93..d9fdedaeb14ecd24705369416f10236febc8719b 100644 (file)
@@ -643,6 +643,11 @@ check_password_quality( struct berval *cred, PassPolicy *pp, LDAPPasswordPolicyE
                                pp->pwdCheckModule, err, 0 );
                        ok = LDAP_OTHER; /* internal error */
                } else {
+                       /* FIXME: the error message ought to be passed thru a
+                        * struct berval, with preallocated buffer and size
+                        * passed in. Module can still allocate a buffer for
+                        * it if the provided one is too small.
+                        */
                        int (*prog)( char *passwd, char **text, Entry *ent );
 
                        if ((prog = lt_dlsym( mod, "check_password" )) == NULL) {
@@ -656,7 +661,7 @@ check_password_quality( struct berval *cred, PassPolicy *pp, LDAPPasswordPolicyE
                                char *txt = NULL;
 
                                ldap_pvt_thread_mutex_lock( &chk_syntax_mutex );
-                               ok = prog( cred->bv_val, &txt, e );
+                               ok = prog( ptr, &txt, e );
                                ldap_pvt_thread_mutex_unlock( &chk_syntax_mutex );
                                if (ok != LDAP_SUCCESS) {
                                        Debug(LDAP_DEBUG_ANY,