mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-01 14:15:49 +08:00
reduce slap_passwd_check to simple form
This commit is contained in:
parent
e5583656ec
commit
831bfa760e
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
@ -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 );
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user