Skip to content
Snippets Groups Projects
Commit 6232170a authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Commit preliminary fix for ldap.conf base usage.

parent 1105b1a8
No related branches found
No related tags found
No related merge requests found
......@@ -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 = "";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment