From: Kurt Zeilenga Date: Mon, 6 Dec 1999 21:42:10 +0000 (+0000) Subject: reduce slap_passwd_check to simple form X-Git-Tag: UCDATA_2_4~137 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=831bfa760eda3c9f7abf50ae75db40afe4f75d68;p=openldap reduce slap_passwd_check to simple form --- diff --git a/servers/slapd/back-bdb2/bind.c b/servers/slapd/back-bdb2/bind.c index 46b614b5c9..c0d405819f 100644 --- a/servers/slapd/back-bdb2/bind.c +++ b/servers/slapd/back-bdb2/bind.c @@ -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 */ diff --git a/servers/slapd/back-ldbm/bind.c b/servers/slapd/back-ldbm/bind.c index b6b902f6be..3935179bc6 100644 --- a/servers/slapd/back-ldbm/bind.c +++ b/servers/slapd/back-ldbm/bind.c @@ -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 */ diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index 916d467814..05d341cb9f 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -21,16 +21,13 @@ 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 ); } } diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 7064a4da49..9c33731773 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -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 ); /*