]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Port ldap.conf patch from -devel.
authorKurt Zeilenga <kurt@openldap.org>
Tue, 1 Dec 1998 21:02:56 +0000 (21:02 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 1 Dec 1998 21:02:56 +0000 (21:02 +0000)
configure
configure.in
libraries/libldap/open.c
libraries/libldap/search.c

index 796fdce4e8f64d9774f9bd8bb918e5f0f17cbd15..4829caa5d58b3ca829034d6bf9eb97c759cfa054 100755 (executable)
--- 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
 
 
index 86f41de85345416cdb6e5e1525441601dc8c1dde..eb5dac5df850b99eadde0e351c79c93d98d25ce5 100644 (file)
@@ -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
index a1e0049d0ab472bd81cfd0e48176d14abf52a00c..624d06bdfa90465e35476704d00eb4ada8b6d90c 100644 (file)
@@ -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
index f3de67766febb1853dc9b59079be49c3adf334da..496394858403cf435ddf022477a5697a8f4e2d14 100644 (file)
@@ -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 = "";
        }