mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-02 04:59:39 -05:00
Commit preliminary fix for ldap.conf base usage.
This commit is contained in:
parent
1105b1a892
commit
6232170a03
2 changed files with 14 additions and 1 deletions
|
|
@ -170,10 +170,17 @@ ldap_init( char *defhost, int defport )
|
|||
return( NULL );
|
||||
}
|
||||
|
||||
if ( openldap_ldap_global_options.ldo_defbase != NULL ) {
|
||||
ld->ld_options.ldo_defbase = ldap_strdup(
|
||||
openldap_ldap_global_options.ldo_defbase);
|
||||
}
|
||||
|
||||
#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
|
||||
if (( ld->ld_selectinfo = ldap_new_select_info()) == NULL ) {
|
||||
free( (char*) ld->ld_options.ldo_defhost );
|
||||
free( (char*) ld->ld_options.ldo_defbase );
|
||||
if ( ld->ld_options.ldo_defbase == NULL ) {
|
||||
free( (char*) ld->ld_options.ldo_defbase );
|
||||
}
|
||||
free( (char*) ld );
|
||||
WSACleanup( );
|
||||
return( NULL );
|
||||
|
|
|
|||
|
|
@ -112,6 +112,12 @@ ldap_build_search_req( LDAP *ld, char *base, int scope, char *filter,
|
|||
}
|
||||
|
||||
if ( base == NULL ) {
|
||||
/* no base provided, use session default base */
|
||||
base = ld->ld_options.ldo_defbase;
|
||||
}
|
||||
|
||||
if ( base == NULL ) {
|
||||
/* no session default base, use top */
|
||||
base = "";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue