]> git.sur5r.net Git - openldap/commitdiff
reduce slap_passwd_check to simple form
authorKurt Zeilenga <kurt@openldap.org>
Mon, 6 Dec 1999 21:42:10 +0000 (21:42 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 6 Dec 1999 21:42:10 +0000 (21:42 +0000)
servers/slapd/back-bdb2/bind.c
servers/slapd/back-ldbm/bind.c
servers/slapd/passwd.c
servers/slapd/proto-slap.h

index 46b614b5c9719a7ec4c50d8dbe5cd0064a6dc912..c0d405819f805749331fda36d38762abcdbf9dde 100644 (file)
@@ -190,8 +190,7 @@ bdb2i_back_bind_internal(
                        goto return_results;
                }
 
-               if ( slap_passwd_check( a->a_vals, cred, a->a_syntax, 0, cred ) != 0 )
-               {
+               if ( slap_passwd_check( a, cred ) != 0 ) {
                        send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
                                NULL, NULL, NULL, NULL);
                        /* stop front end from sending result */
index b6b902f6beeb53c889df9e0d0ed8880a39dac0e6..3935179bc6c3874113bd367325cbd8fd9363880a 100644 (file)
@@ -197,8 +197,7 @@ ldbm_back_bind(
                        goto return_results;
                }
 
-               if ( slap_passwd_check( a->a_vals, cred, a->a_syntax, 0, cred ) != 0 )
-               {
+               if ( slap_passwd_check( a, cred ) != 0 ) {
                        send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
                                NULL, NULL, NULL, NULL );
                        /* stop front end from sending result */
index 916d46781435629750e7086fb24f17029e985063..05d341cb9f5a59d2da0682dfd70e595ca8690788 100644 (file)
 
 int
 slap_passwd_check(
-       struct berval       **vals,
-       struct berval       *v,
-       int                 syntax,
-       int                 normalize,
+       Attribute *a,
        struct berval           *cred
 )
 {
        int     i;
-       for ( i = 0; vals[i] != NULL; i++ ) {
-               if ( syntax == SYNTAX_BIN ) {
+       for ( i = 0; a->a_vals[i] != NULL; i++ ) {
+               if ( a->a_syntax == SYNTAX_BIN ) {
                        int result;
 
 #ifdef SLAPD_CRYPT
@@ -39,7 +36,7 @@ slap_passwd_check(
 
                        result = lutil_passwd(
                                (char*) cred->bv_val,
-                               (char*) vals[i]->bv_val,
+                               (char*) a->a_vals[i]->bv_val,
                                NULL );
 
 #ifdef SLAPD_CRYPT
@@ -49,7 +46,7 @@ slap_passwd_check(
                        return result;
 
                } else {
-                if ( value_cmp( vals[i], v, syntax, normalize ) == 0 ) {
+                if ( value_cmp( a->a_vals[i], cred, a->a_syntax, 1 ) == 0 ) {
                         return( 0 );
                 }
         }
index 7064a4da49d6b335043287460622aeac65b444c9..9c337317733bf6fcd10766d49efff07f61ddf6f0 100644 (file)
@@ -443,10 +443,7 @@ LIBSLAPD_F (void) slap_init_user LDAP_P(( char *username, char *groupname ));
  * passwd.c
  */
 LIBSLAPD_F (int) slap_passwd_check(
-       struct berval       **vals,
-       struct berval       *v,
-       int                 syntax,
-       int                 normalize,
+       Attribute                       *attr,
        struct berval           *cred );
 
 /*