From: Kurt Zeilenga Date: Tue, 1 Dec 1998 21:02:56 +0000 (+0000) Subject: Port ldap.conf patch from -devel. X-Git-Tag: OPENLDAP_REL_ENG_1_1_0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cddb59b2091abbc99060c7cde132c1536f231bbf;p=thirdparty%2Fopenldap.git Port ldap.conf patch from -devel. --- diff --git a/configure b/configure index 796fdce4e8..4829caa5d5 100755 --- a/configure +++ b/configure @@ -77,7 +77,7 @@ ac_help="$ac_help --enable-static=PKGS only build shared libraries if the current package appears as an element in the PKGS list" ac_help="$ac_help - --enable-shared build shared libraries [default=yes] + --enable-shared build shared libraries [default=no] --enable-shared=PKGS only build shared libraries if the current package appears as an element in the PKGS list" ac_help="$ac_help @@ -1434,7 +1434,7 @@ no) enable_shared=no ;; ;; esac else - enable_shared=yes + enable_shared=no fi diff --git a/configure.in b/configure.in index 86f41de853..eb5dac5df8 100644 --- a/configure.in +++ b/configure.in @@ -89,8 +89,8 @@ OL_ARG_ENABLE(slurpd,[ --enable-slurpd enable building slurpd], auto)dnl AC_ARG_WITH(xxliboptions,[Library Generation & Linking Options]) AM_ENABLE_STATIC -dnl AM_DISABLE_SHARED -AM_ENABLE_SHARED +AM_DISABLE_SHARED +dnl AM_ENABLE_SHARED dnl General "enable" options # validate options diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index a1e0049d0a..624d06bdfa 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -148,36 +148,43 @@ ldap_init( char *defhost, int defport ) return( NULL ); } -#ifdef LDAP_REFERRALS - if (( ld->ld_selectinfo = ldap_new_select_info()) == NULL ) { + /* copy the global options */ + ld->ld_defport = openldap_ldap_global_options.ldo_defport; + ld->ld_deref = openldap_ldap_global_options.ldo_deref; + ld->ld_sizelimit = openldap_ldap_global_options.ldo_sizelimit; + ld->ld_timelimit = openldap_ldap_global_options.ldo_timelimit; + + if ( defhost != NULL ) { + ld->ld_defhost = ldap_strdup( defhost ); + } else { + ld->ld_defhost = ldap_strdup( + openldap_ldap_global_options.ldo_defhost); + } + + if( ld->ld_defhost == NULL ) { free( (char*)ld ); WSACleanup( ); return( NULL ); } - ld->ld_options = LDAP_OPT_REFERRALS; -#endif /* LDAP_REFERRALS */ - if ( defhost != NULL && - ( ld->ld_defhost = ldap_strdup( defhost )) == NULL ) { #ifdef LDAP_REFERRALS - ldap_free_select_info( ld->ld_selectinfo ); -#endif /* LDAP_REFERRALS */ + if (( ld->ld_selectinfo = ldap_new_select_info()) == NULL ) { + free( (char*) ld->ld_defhost ); free( (char*)ld ); WSACleanup( ); return( NULL ); } + ld->ld_options = LDAP_OPT_REFERRALS; +#endif /* LDAP_REFERRALS */ + if(defport != 0) { + ld->ld_defport = defport; + } - ld->ld_defport = ( defport == 0 ) ? - openldap_ldap_global_options.ldo_defport : defport; ld->ld_version = LDAP_VERSION; ld->ld_lberoptions = LBER_USE_DER; ld->ld_refhoplimit = LDAP_DEFAULT_REFHOPLIMIT; -#ifdef LDAP_REFERRALS - ld->ld_options |= LDAP_OPT_REFERRALS; -#endif /* LDAP_REFERRALS */ - #if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET ) ld->ld_lberoptions |= LBER_TRANSLATE_STRINGS; #if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index f3de67766f..4963948584 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -114,6 +114,12 @@ ldap_build_search_req( LDAP *ld, char *base, int scope, char *filter, } if ( base == NULL ) { + /* no base provided, use global default base */ + base = openldap_ldap_global_options.ldo_defbase; + } + + if ( base == NULL ) { + /* no session default base, use top */ base = ""; }