]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/search.c
allow backwards compatibility for 'T' option (single char)
[openldap] / servers / slapd / search.c
index 1bbe73e2dca6b692635709bca390b44215cc95c6..52e7d5a3dafdbf40e95368393aaae60f216d1618 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2004 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,7 +35,7 @@
 #include "slap.h"
 
 #ifdef LDAP_SLAPI
-#include "slapi.h"
+#include "slapi/slapi.h"
 
 static char **anlist2charray( Operation *op, AttributeName *an );
 static void init_search_pblock( Operation *op, char **attrs, int managedsait );
@@ -49,7 +49,7 @@ do_search(
     Operation  *op,    /* info about the op to which we're responding */
     SlapReply  *rs     /* all the response data we'll send */
 ) {
-       struct berval base = { 0, NULL };
+       struct berval base = BER_BVNULL;
        ber_len_t       siz, off, i;
        int                     manageDSAit;
        int                     be_manageDSAit;
@@ -102,7 +102,9 @@ do_search(
        case LDAP_SCOPE_BASE:
        case LDAP_SCOPE_ONELEVEL:
        case LDAP_SCOPE_SUBTREE:
+#ifdef LDAP_SCOPE_SUBORDINATE
        case LDAP_SCOPE_SUBORDINATE:
+#endif
                break;
        default:
                send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "invalid scope" );
@@ -398,7 +400,7 @@ do_search(
 #endif /* LDAP_SLAPI */
 
        /* actually do the search and send the result(s) */
-       if ( op->o_bd->be_search ) {
+       if ( op->o_bd->be_search && limits_check( op, rs ) == 0 ) {
                (op->o_bd->be_search)( op, rs );
        } else {
                send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,