]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/search.c
Fix ldap_send_initial_request() to open connection if not already
[openldap] / libraries / libldap / search.c
index 3ac8de74895a0198844cce6935ab4325a7aeac18..4aa78fb4f2cbffc4d958f4108160e422ddbec98e 100644 (file)
@@ -1,4 +1,8 @@
 /*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/*  Portions
  *  Copyright (c) 1990 Regents of the University of Michigan.
  *  All rights reserved.
  *
@@ -7,10 +11,6 @@
 
 #include "portable.h"
 
-#ifndef lint 
-static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -18,7 +18,6 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of
 #include <ac/socket.h>
 #include <ac/string.h>
 #include <ac/time.h>
-extern char *strdup (const char *);
 
 #include "ldap-int.h"
 
@@ -113,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 = "";
        }