Commit preliminary fix for ldap.conf base usage.

This commit is contained in:
Kurt Zeilenga 1998-12-01 20:08:39 +00:00
parent 1105b1a892
commit 6232170a03
2 changed files with 14 additions and 1 deletions

View file

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

View file

@ -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 = "";
}