]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/filterindex.c
ITS#2888 don't return LDAP_SIZELIMIT_EXCEEDED prematurely
[openldap] / servers / slapd / back-ldbm / filterindex.c
index 95ba7c6cf2bc45908a73a98952af41d310c82941..e7d17af8f3daf3d55eb3ab55a533a212596e63ec 100644 (file)
@@ -1,8 +1,17 @@
 /* filterindex.c - generate the list of candidate entries from a filter */
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2003 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
 
 #include "portable.h"
@@ -47,6 +56,22 @@ filter_candidates(
 
        result = NULL;
        switch ( f->f_choice ) {
+       case SLAPD_FILTER_COMPUTED:
+               switch( f->f_result ) {
+               case SLAPD_COMPARE_UNDEFINED:
+               /* This technically is not the same as FALSE, but it
+                * certainly will produce no matches.
+                */
+               /* FALLTHRU */
+               case LDAP_COMPARE_FALSE:
+                       result = NULL;
+                       break;
+               case LDAP_COMPARE_TRUE:
+                       result = idl_allids( op->o_bd );
+                       break;
+               }
+               break;
+
        case SLAPD_FILTER_DN_ONE:
 #ifdef NEW_LOGGING
                LDAP_LOG( FILTER, DETAIL1,