]> git.sur5r.net Git - openldap/commitdiff
ITS#3777 fix scheme comparison
authorHoward Chu <hyc@openldap.org>
Wed, 15 Jun 2005 03:06:48 +0000 (03:06 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 15 Jun 2005 03:06:48 +0000 (03:06 +0000)
servers/slapd/overlays/ppolicy.c

index 9941f865dca0888bed07f5e5c839b38d04eb98f5..af1dd5a15324521c8de49502969cc230c7a4a225 100644 (file)
@@ -413,12 +413,13 @@ password_scheme( struct berval *cred, struct berval *sch )
 
        for(e = 1; cred->bv_val[e] && cred->bv_val[e] != '}'; e++);
        if (cred->bv_val[e]) {
+               int rc;
                char *sc = ch_calloc( sizeof(char), e + 2);
                sc[e + 1] = '\0'; /* terminate string */
                strncpy( sc, cred->bv_val, e + 1);
-               e = lutil_passwd_scheme( sc );
+               rc = lutil_passwd_scheme( sc );
                free( sc );
-               if (e && sch) {
+               if (rc && sch) {
                        sch->bv_val = cred->bv_val;
                        sch->bv_len = e;
                        return LDAP_SUCCESS;