]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/search.c
Added the functions ldap_rename2() and ldap_rename2_s() to support LDAP
[openldap] / libraries / libldap / search.c
index 191d346710778af55129c3e6229d24635b60f3d3..117d5f4d2ee1f7b9db238d6ca25502433bee531a 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>
 
@@ -19,8 +19,6 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of
 #include <ac/string.h>
 #include <ac/time.h>
 
-#include "lber.h"
-#include "ldap.h"
 #include "ldap-int.h"
 
 static char *find_right_paren LDAP_P(( char *s ));
@@ -114,11 +112,17 @@ 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 = "";
        }
 
 #ifdef LDAP_CONNECTIONLESS
-       if ( ld->ld_sb.sb_naddr > 0 ) {
+       if ( ld->ld_cldapnaddr > 0 ) {
            err = ber_printf( ber, "{ist{seeiib", ++ld->ld_msgid,
                ld->ld_cldapdn, LDAP_REQ_SEARCH, base, scope, ld->ld_deref,
                ld->ld_sizelimit, ld->ld_timelimit, attrsonly );
@@ -400,7 +404,7 @@ put_filter_list( BerElement *ber, char *str )
        Debug( LDAP_DEBUG_TRACE, "put_filter_list \"%s\"\n", str, 0, 0 );
 
        while ( *str ) {
-               while ( *str && isspace( *str ) )
+               while ( *str && isspace( (unsigned char) *str ) )
                        str++;
                if ( *str == '\0' )
                        break;