]> git.sur5r.net Git - openldap/commitdiff
Define MINIMUM_SEARCH_STACK_DEPTH=8, search_aliases needs at least this.
authorHoward Chu <hyc@openldap.org>
Sat, 5 Apr 2003 10:05:27 +0000 (10:05 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 5 Apr 2003 10:05:27 +0000 (10:05 +0000)
servers/slapd/back-bdb/back-bdb.h
servers/slapd/back-bdb/config.c

index efc6de9b3dcbe62b34c39afa37988fbbde45c1d5..3ea577577676d17af1d9593e75cacba7f4251ca3 100644 (file)
@@ -65,6 +65,9 @@ LDAP_BEGIN_DECL
 /* The default search IDL stack cache depth */
 #define DEFAULT_SEARCH_STACK_DEPTH     16
 
+/* The minimum we can function with */
+#define MINIMUM_SEARCH_STACK_DEPTH     8
+
 /* for the IDL cache */
 #define SLAP_IDL_CACHE 1
 
index 8fd2e23272e65de63e19fc5357a42a689b5a94f6..12bf4d73244bc22141cde250ec548262d34c225d 100644 (file)
@@ -137,13 +137,20 @@ bdb_db_config(
 
        /* depth of search stack cache in units of (IDL)s */
         } else if ( strcasecmp( argv[0], "searchstack" ) == 0 ) {
-                 if ( argc < 2 ) {
-                         fprintf( stderr,
-                 "%s: line %d: missing depth in \"searchstack <depth>\" line\n",
-                             fname, lineno );
-                         return( 1 );
-                 }
-                 bdb->bi_search_stack_depth = atoi( argv[1] );
+               if ( argc < 2 ) {
+                       fprintf( stderr,
+               "%s: line %d: missing depth in \"searchstack <depth>\" line\n",
+                       fname, lineno );
+                       return( 1 );
+               }
+               bdb->bi_search_stack_depth = atoi( argv[1] );
+               if ( bdb->bi_search_stack_depth < MINIMUM_SEARCH_STACK_DEPTH ) {
+                       fprintf( stderr,
+               "%s: line %d: depth %d too small, using %d\n",
+                       fname, lineno, bdb->bi_search_stack_depth,
+                       MINIMUM_SEARCH_STACK_DEPTH );
+                       bdb->bi_search_stack_depth = MINIMUM_SEARCH_STACK_DEPTH;
+               }
 
 #ifdef SLAP_IDL_CACHE
        /* size of the IDL cache in entries */