]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/search.c
add referral check to functions elaborated by overlays
[openldap] / servers / slapd / search.c
index 1bbe73e2dca6b692635709bca390b44215cc95c6..91dcdb2b2f0115d29affcc522e9ee285b489150f 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 );
@@ -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,