]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/passwd.c
update for new backend types
[openldap] / servers / slapd / passwd.c
index 270b1148b21e920f1d56f9877d7f2d002eece78d..82acabab4a343a77d5b41ed08f82a2d431b662d2 100644 (file)
@@ -213,6 +213,7 @@ int passwd_extop(
        ml->sml_nvalues = NULL;
        ml->sml_desc = slap_schema.si_ad_userPassword;
        ml->sml_op = LDAP_MOD_REPLACE;
+       ml->sml_flags = 0;
        ml->sml_next = qpw->rs_mods;
        qpw->rs_mods = ml;
 
@@ -469,7 +470,7 @@ slap_passwd_hash_type(
        new->bv_len = 0;
        new->bv_val = NULL;
 
-       assert( hash );
+       assert( hash != NULL );
 
        lutil_passwd_hash( cred , hash, new, text );
 }
@@ -509,8 +510,10 @@ static int slapd_crypt( const char *key, const char *salt, char **hash )
                if ( hash ) {
                        *hash = ber_strdup( cr );
                        rc = LUTIL_PASSWD_OK;
+
+               } else {
+                       rc = strcmp( salt, cr ) ? LUTIL_PASSWD_ERR : LUTIL_PASSWD_OK;
                }
-               rc = strcmp( salt, cr ) ? LUTIL_PASSWD_ERR : LUTIL_PASSWD_OK;
        }
 
        ldap_pvt_thread_mutex_unlock( &passwd_mutex );