reduce slap_passwd_check to simple form

This commit is contained in:
Kurt Zeilenga 1999-12-06 21:42:10 +00:00
parent e5583656ec
commit 831bfa760e
4 changed files with 8 additions and 16 deletions

View 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 */

View 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 */

View File

@ -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 );
}
}

View 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 );
/*