+ /* set sockbuf max */
+ } else if ( strcasecmp( cargv[0], "sockbuf_max_incoming" ) == 0 ) {
+ long max;
+ if ( cargc < 2 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+ "%s: line %d: missing max in \"sockbuf_max_incoming <bytes>\" line\n",
+ fname, lineno ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "%s: line %d: missing max in \"sockbuf_max_incoming <bytes>\" line\n",
+ fname, lineno, 0 );
+#endif
+
+ return( 1 );
+ }
+
+ max = atol( cargv[1] );
+
+ if( max < 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+ "%s: line %d: invalid max value (%ld) in "
+ "\"sockbuf_max_incoming <bytes>\" line.\n",
+ fname, lineno, max ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "%s: line %d: invalid max value (%ld) in "
+ "\"sockbuf_max_incoming <bytes>\" line.\n",
+ fname, lineno, max );
+#endif
+
+ return( 1 );
+ }
+
+ sockbuf_max_incoming = max;
+
+ /* set sockbuf max authenticated */
+ } else if ( strcasecmp( cargv[0], "sockbuf_max_incoming_auth" ) == 0 ) {
+ long max;
+ if ( cargc < 2 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+ "%s: line %d: missing max in \"sockbuf_max_incoming_auth <bytes>\" line\n",
+ fname, lineno ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "%s: line %d: missing max in \"sockbuf_max_incoming_auth <bytes>\" line\n",
+ fname, lineno, 0 );
+#endif
+
+ return( 1 );
+ }
+
+ max = atol( cargv[1] );
+
+ if( max < 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+ "%s: line %d: invalid max value (%ld) in "
+ "\"sockbuf_max_incoming_auth <bytes>\" line.\n",
+ fname, lineno, max ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "%s: line %d: invalid max value (%ld) in "
+ "\"sockbuf_max_incoming_auth <bytes>\" line.\n",
+ fname, lineno, max );
+#endif
+
+ return( 1 );
+ }
+
+ sockbuf_max_incoming_auth = max;
+
+ /* default search base */
+ } else if ( strcasecmp( cargv[0], "defaultSearchBase" ) == 0 ) {
+ if ( cargc < 2 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+ "%s: line %d: missing dn in \"defaultSearchBase <dn\" "
+ "line\n", fname, lineno ));
+#else
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: "
+ "missing dn in \"defaultSearchBase <dn>\" line\n",
+ fname, lineno, 0 );
+#endif
+
+ return 1;
+
+ } else if ( cargc > 2 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+ "%s: line %d: extra cruft after <dn> in "
+ "\"defaultSearchBase %s\" line (ignored)\n",
+ fname, lineno, cargv[1] ));
+#else
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: "
+ "extra cruft after <dn> in \"defaultSearchBase %s\", "
+ "line (ignored)\n",
+ fname, lineno, cargv[1] );
+#endif
+ }
+
+ if ( bi != NULL || be != NULL ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+ "%s: line %d: defaultSearchBase line must appear "
+ "prior to any backend or database definitions\n",
+ fname, lineno ));
+#else
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: "
+ "defaultSearchBaase line must appear prior to "
+ "any backend or database definition\n",
+ fname, lineno, 0 );
+#endif
+
+ return 1;
+ }
+
+ if ( default_search_nbase.bv_len ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_INFO, "%s: line %d: "
+ "default search base \"%s\" already defined "
+ "(discarding old)\n", fname, lineno,
+ default_search_base->bv_val ));
+#else
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: "
+ "default search base \"%s\" already defined "
+ "(discarding old)\n",
+ fname, lineno, default_search_base.bv_val );
+#endif
+
+ free( default_search_base.bv_val );
+ free( default_search_nbase.bv_val );
+ }
+
+ if ( load_ucdata( NULL ) < 0 ) return 1;
+
+ {
+ struct berval dn;
+
+ dn.bv_val = cargv[1];
+ dn.bv_len = strlen( dn.bv_val );
+
+ rc = dnPrettyNormal( NULL, &dn,
+ &default_search_base,
+ &default_search_nbase );
+
+ if( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+ "%s: line %d: defaultSearchBase DN is invalid.\n",
+ fname, lineno ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "%s: line %d: defaultSearchBase DN is invalid\n",
+ fname, lineno, 0 );
+#endif
+ return( 1 );
+ }
+ }
+