mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-17 14:00:30 +08:00
Fix minor memory leak and remove redundant be_isroot_pw() checks.
Suggested by Pierangelo Masarati <pmasarati@bci.it> in post to -bugs.
This commit is contained in:
parent
180eed16fe
commit
3984323bf9
@ -118,39 +118,35 @@ ldbm_back_bind(
|
||||
/* stop front end from sending result */
|
||||
rc = 1;
|
||||
goto return_results;
|
||||
} else if ( be_isroot_pw( be, dn, cred ) ) {
|
||||
}
|
||||
|
||||
/* check for root dn/passwd */
|
||||
if ( be_isroot_pw( be, dn, cred ) ) {
|
||||
/* front end will send result */
|
||||
if(*edn != NULL) free( edn );
|
||||
*edn = ch_strdup( be_root_dn( be ) );
|
||||
rc = 0;
|
||||
goto return_results;
|
||||
}
|
||||
|
||||
if ( (a = attr_find( e->e_attrs, "userpassword" )) == NULL ) {
|
||||
if ( be_isroot_pw( be, dn, cred ) ) {
|
||||
/* front end will send result */
|
||||
*edn = ch_strdup( be_root_dn( be ) );
|
||||
rc = 0;
|
||||
goto return_results;
|
||||
}
|
||||
send_ldap_result( conn, op, LDAP_INAPPROPRIATE_AUTH,
|
||||
NULL, NULL );
|
||||
|
||||
/* stop front end from sending result */
|
||||
rc = 1;
|
||||
goto return_results;
|
||||
}
|
||||
|
||||
if ( crypted_value_find( a->a_vals, cred, a->a_syntax, 0, cred ) != 0 )
|
||||
{
|
||||
if ( be_isroot_pw( be, dn, cred ) ) {
|
||||
/* front end will send result */
|
||||
*edn = ch_strdup( be_root_dn( be ) );
|
||||
rc = 0;
|
||||
goto return_results;
|
||||
}
|
||||
send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
|
||||
NULL, NULL );
|
||||
/* stop front end from sending result */
|
||||
rc = 1;
|
||||
goto return_results;
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
break;
|
||||
|
||||
@ -176,6 +172,7 @@ ldbm_back_bind(
|
||||
NULL, NULL );
|
||||
rc = 1;
|
||||
goto return_results;
|
||||
|
||||
} else { /* look for krbName match */
|
||||
struct berval krbval;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user