Browse Source

Bug 491733 - dbtest crashes

https://bugzilla.redhat.com/show_bug.cgi?id=491733

Description: Getting rid of the dbtest.c file and its command line
option in main.c.  The tool is obsolete (new idl format is not
supported).
Noriko Hosoi 15 years ago
parent
commit
5fb379f35c

+ 0 - 1
Makefile.am

@@ -682,7 +682,6 @@ libback_ldbm_la_SOURCES = ldap/servers/slapd/back-ldbm/ancestorid.c \
 	ldap/servers/slapd/back-ldbm/dbhelp.c \
 	ldap/servers/slapd/back-ldbm/dblayer.c \
 	ldap/servers/slapd/back-ldbm/dbsize.c \
-	ldap/servers/slapd/back-ldbm/dbtest.c \
 	ldap/servers/slapd/back-ldbm/dbversion.c \
 	ldap/servers/slapd/back-ldbm/dn2entry.c \
 	ldap/servers/slapd/back-ldbm/entrystore.c \

+ 1 - 15
Makefile.in

@@ -175,7 +175,6 @@ am_libback_ldbm_la_OBJECTS =  \
 	ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbhelp.lo \
 	ldap/servers/slapd/back-ldbm/libback_ldbm_la-dblayer.lo \
 	ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbsize.lo \
-	ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbtest.lo \
 	ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbversion.lo \
 	ldap/servers/slapd/back-ldbm/libback_ldbm_la-dn2entry.lo \
 	ldap/servers/slapd/back-ldbm/libback_ldbm_la-entrystore.lo \
@@ -1107,6 +1106,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
@@ -1800,7 +1800,6 @@ libback_ldbm_la_SOURCES = ldap/servers/slapd/back-ldbm/ancestorid.c \
 	ldap/servers/slapd/back-ldbm/dbhelp.c \
 	ldap/servers/slapd/back-ldbm/dblayer.c \
 	ldap/servers/slapd/back-ldbm/dbsize.c \
-	ldap/servers/slapd/back-ldbm/dbtest.c \
 	ldap/servers/slapd/back-ldbm/dbversion.c \
 	ldap/servers/slapd/back-ldbm/dn2entry.c \
 	ldap/servers/slapd/back-ldbm/entrystore.c \
@@ -2799,9 +2798,6 @@ ldap/servers/slapd/back-ldbm/libback_ldbm_la-dblayer.lo:  \
 ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbsize.lo:  \
 	ldap/servers/slapd/back-ldbm/$(am__dirstamp) \
 	ldap/servers/slapd/back-ldbm/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbtest.lo:  \
-	ldap/servers/slapd/back-ldbm/$(am__dirstamp) \
-	ldap/servers/slapd/back-ldbm/$(DEPDIR)/$(am__dirstamp)
 ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbversion.lo:  \
 	ldap/servers/slapd/back-ldbm/$(am__dirstamp) \
 	ldap/servers/slapd/back-ldbm/$(DEPDIR)/$(am__dirstamp)
@@ -4967,8 +4963,6 @@ mostlyclean-compile:
 	-rm -f ldap/servers/slapd/back-ldbm/libback_ldbm_la-dblayer.lo
 	-rm -f ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbsize.$(OBJEXT)
 	-rm -f ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbsize.lo
-	-rm -f ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbtest.$(OBJEXT)
-	-rm -f ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbtest.lo
 	-rm -f ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbverify.$(OBJEXT)
 	-rm -f ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbverify.lo
 	-rm -f ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbversion.$(OBJEXT)
@@ -5753,7 +5747,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dbhelp.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dblayer.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dbsize.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dbtest.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dbverify.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dbversion.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dn2entry.Plo@am__quote@
@@ -6253,13 +6246,6 @@ ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbsize.lo: ldap/servers/slapd/back-
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libback_ldbm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbsize.lo `test -f 'ldap/servers/slapd/back-ldbm/dbsize.c' || echo '$(srcdir)/'`ldap/servers/slapd/back-ldbm/dbsize.c
 
-ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbtest.lo: ldap/servers/slapd/back-ldbm/dbtest.c
-@am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libback_ldbm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbtest.lo -MD -MP -MF ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dbtest.Tpo -c -o ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbtest.lo `test -f 'ldap/servers/slapd/back-ldbm/dbtest.c' || echo '$(srcdir)/'`ldap/servers/slapd/back-ldbm/dbtest.c
-@am__fastdepCC_TRUE@	$(am__mv) ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dbtest.Tpo ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dbtest.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ldap/servers/slapd/back-ldbm/dbtest.c' object='ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbtest.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libback_ldbm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbtest.lo `test -f 'ldap/servers/slapd/back-ldbm/dbtest.c' || echo '$(srcdir)/'`ldap/servers/slapd/back-ldbm/dbtest.c
-
 ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbversion.lo: ldap/servers/slapd/back-ldbm/dbversion.c
 @am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libback_ldbm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbversion.lo -MD -MP -MF ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dbversion.Tpo -c -o ldap/servers/slapd/back-ldbm/libback_ldbm_la-dbversion.lo `test -f 'ldap/servers/slapd/back-ldbm/dbversion.c' || echo '$(srcdir)/'`ldap/servers/slapd/back-ldbm/dbversion.c
 @am__fastdepCC_TRUE@	$(am__mv) ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dbversion.Tpo ldap/servers/slapd/back-ldbm/$(DEPDIR)/libback_ldbm_la-dbversion.Plo

+ 2 - 2
aclocal.m4

@@ -13,8 +13,8 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
-[m4_warning([this file was generated for autoconf 2.63.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])

+ 6 - 0
config.h.in

@@ -245,6 +245,9 @@
    */
 #undef HAVE_SYS_NDIR_H
 
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
 /* Define to 1 if you have the <sys/socket.h> header file. */
 #undef HAVE_SYS_SOCKET_H
 
@@ -361,6 +364,9 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 

File diff suppressed because it is too large
+ 395 - 440
configure


+ 0 - 349
ldap/servers/slapd/back-ldbm/dbtest.c

@@ -1,349 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * This Program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation; version 2 of the License.
- * 
- * This Program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License along with
- * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA.
- * 
- * In addition, as a special exception, Red Hat, Inc. gives You the additional
- * right to link the code of this Program with code not covered under the GNU
- * General Public License ("Non-GPL Code") and to distribute linked combinations
- * including the two, subject to the limitations in this paragraph. Non-GPL Code
- * permitted under this exception must only link to the code of this Program
- * through those well defined interfaces identified in the file named EXCEPTION
- * found in the source code files (the "Approved Interfaces"). The files of
- * Non-GPL Code may instantiate templates or use macros or inline functions from
- * the Approved Interfaces without causing the resulting work to be covered by
- * the GNU General Public License. Only Red Hat, Inc. may make changes or
- * additions to the list of Approved Interfaces. You must obey the GNU General
- * Public License in all respects for all of the Program code and other code used
- * in conjunction with the Program except the Non-GPL Code covered by this
- * exception. If you modify this file, you may extend this exception to your
- * version of the file, but you are not obligated to do so. If you do not wish to
- * provide this exception without modification, you must delete this exception
- * statement from your version and license this file solely under the GPL without
- * exception. 
- * 
- * 
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-/* dbtest.c - ldbm database test program */
-
-#include "back-ldbm.h"
-
-#define SLAPI_LDBM_DBTEST_OPT_DUMPDATA			0x0001
-#define SLAPI_LDBM_DBTEST_OPT_KEY_IS_BINARY		0x0002
-#define SLAPI_LDBM_DBTEST_OPT_DATA_IS_BINARY	0x0004
-#define SLAPI_LDBM_DBTEST_OPT_DATA_IS_IDLIST	0x0008
-#define SLAPI_LDBM_DBTEST_OPT_KEY_IS_ID			0x0010
-
-static void		dbtest_help( void );
-static void		dbtest_traverse( DB *db, char *filename, unsigned int options,
-						FILE *outfp );
-static void		dbtest_print_idlist( char *keystr, void *p,  u_int32_t size,
-						FILE *outfp );
-static void		dbtest_bprint( char *data, int len, char *lineprefix,
-						FILE *outfp );
-
-int ldbm_back_db_test( Slapi_PBlock *pb )
-{
-	char			buf[256], *instance_name;
-	backend			*be;
-	struct ldbminfo	*li;
-    ldbm_instance	*inst;
-	struct attrinfo	*ai;
-	DB				*db;
-	int				err, traversal_options;
-
-	slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
-
-	/* essential initialization */ 
-	mapping_tree_init();
-	ldbm_config_load_dse_info(li);
-	/* Turn off transactions */
-	ldbm_config_internal_set(li, CONFIG_DB_TRANSACTION_LOGGING, "off");
-
-    /* Find the instance */
-    slapi_pblock_get( pb, SLAPI_BACKEND_INSTANCE_NAME, &instance_name );
-    inst = ldbm_instance_find_by_name(li, instance_name);
-    if (NULL == inst) {
-		LDAPDebug(LDAP_DEBUG_ANY, "dbtest: unknown ldbm instance %s\n",
-				instance_name, 0, 0);
-		return -1;
-    }
-
-	/* store the be in the pb */
-	be = inst->inst_be;
-	slapi_pblock_set(pb, SLAPI_BACKEND, be);
-	
-    /***** prepare & init libdb, dblayer, and dbinstance *****/
-	if (0 != dblayer_start(li, DBLAYER_TEST_MODE)) {
-		LDAPDebug( LDAP_DEBUG_ANY,
-		    "dbtest: Failed to init database\n", 0, 0, 0 );
-		return( -1 );
-	}
-    if ( 0 != dblayer_instance_start(inst->inst_be, DBLAYER_NORMAL_MODE)) {
-		LDAPDebug( LDAP_DEBUG_ANY,
-		    "dbtest: failed to start instance\n", 0, 0, 0 );
-		return( -1 );
-	}
-
-	/* display commands help test */
-	dbtest_help();
-
-	while ( 1 ) {
-		traversal_options = 0;
-		fputs( "dbtest: ", stdout );
-
-		if ( fgets( buf, sizeof(buf), stdin ) == NULL )
-			break;
-
-		switch ( buf[0] ) {
-		case 'i':
-			traversal_options |= SLAPI_LDBM_DBTEST_OPT_DATA_IS_IDLIST;
-			/*FALLTHRU*/
-
-		case 't':
-			traversal_options |= SLAPI_LDBM_DBTEST_OPT_DUMPDATA;
-			/*FALLTHRU*/
-
-		case 'T':
-			/* read the index to traverse */
-			fputs( " attr: ", stdout );
-			if ( fgets( buf, sizeof(buf), stdin ) == NULL ) {
-				exit( 0 );
-			}
-			buf[strlen( buf ) - 1] = '\0';
-			ai = NULL;
-			ainfo_get( be, buf, &ai );
-			if ( ai == NULL ) {
-				fprintf( stderr, "no index for %s\n", buf );
-				continue;
-			}
-
-			/* open the index file */
-			if ( (err = dblayer_get_index_file( be, ai, &db, 0 /* no create */ ))
-			    != 0 ) {
-				fprintf( stderr, "could not get index for %s (error %d - %s)\n",
-				    buf, err, dblayer_strerror( err ));
-				continue;
-			}
-
-			/* traverse the file */
-			traversal_options |= SLAPI_LDBM_DBTEST_OPT_DATA_IS_BINARY;
-			dbtest_traverse( db, buf, traversal_options, stdout );
-
-			/* clean up */
-			dblayer_release_index_file( be, ai, db );
-			break;
-
-		case 'u':
-			traversal_options |= SLAPI_LDBM_DBTEST_OPT_DUMPDATA;
-			/*FALLTHRU*/
-
-		case 'U':
-			/* open the id2entry file */
-			if ( (err = dblayer_get_id2entry( be, &db )) != 0 ) {
-				fprintf( stderr, "could not get i2entry\n" );
-				continue;
-			}
-
-			/* traverse the file */
-			traversal_options |= SLAPI_LDBM_DBTEST_OPT_KEY_IS_ID;
-			dbtest_traverse( db, "id2entry", traversal_options, stdout );
-
-			/* clean up */
-			dblayer_release_id2entry( be, db );
-			break;
-
-		default:
-			dbtest_help();
-			break;
-		}
-	}
-
-	return( 0 );
-}
-
-
-static void
-dbtest_help()
-{
-			puts( LDBM_DATABASE_TYPE_NAME " test mode" );
-			puts( "\nindex key prefixes:" );
-			printf( "          %c  presence      (sn=*)\n", PRES_PREFIX );
-			printf( "          %c  equality      (sn=jensen)\n", EQ_PREFIX );
-			printf( "          %c  approximate   (sn~=jensin)\n", APPROX_PREFIX );
-			printf( "          %c  substring     (sn=jen*)\n", SUB_PREFIX );
-			printf( "          %c  matching rule (sn:1.2.3.4.5:=Jensen)\n", RULE_PREFIX );
-			printf( "          %c  continuation\n", CONT_PREFIX );
-
-			puts( "\ncommands: i => traverse index keys and ID list values" );
-			puts( "          t => traverse index keys and values" );
-			puts( "          T => traverse index keys" );
-			puts( "          u => traverse id2entry keys and values" );
-			puts( "          U => traverse id2entry keys" );
-#if 0
-			puts( "          l<c> => lookup index" );
-			puts( "          L<c> => lookup index (all)" );
-			puts( "          t<c> => traverse index keys and values" );
-			puts( "          T<c> => traverse index keys" );
-			puts( "          x<c> => delete from index" );
-			puts( "          e<c> => edit index entry" );
-			puts( "          a<c> => add index entry" );
-			puts( "          c<c> => create index" );
-			puts( "          i<c> => insert ids into index" );
-			puts( "          b    => change default backend" );
-			puts( "          B    => print default backend" );
-			puts( "          d<n> => set slapd_ldap_debug to n" );
-			puts( "where <c> is a char selecting the index:" );
-			puts( "          c => id2children" );
-			puts( "          d => dn2id" );
-			puts( "          e => id2entry" );
-			puts( "          f => arbitrary file" );
-			puts( "          i => attribute index" );
-#endif /* 0 */
-}
-
-
-/*
- * get a cursor and walk over the databasea
- */
-static void
-dbtest_traverse( DB *db, char *filename, unsigned int options, FILE *outfp )
-{
-	DBC				*dbc;
-	DBT				key, data;
-
-	dbc = NULL;
-	if ( db->cursor( db, NULL, &dbc, 0 ) != 0 ) {
-		fprintf( stderr, "could not get cursor for %s\n", filename );
-		return;
-	}
-
-	memset( &key, 0, sizeof(key) );
-	memset( &data, 0, sizeof(data) );
-	key.flags = DB_DBT_MALLOC;
-	data.flags = DB_DBT_MALLOC;
-	while ( dbc->c_get( dbc, &key, &data, DB_NEXT ) == 0 ) {
-		if (( options & SLAPI_LDBM_DBTEST_OPT_KEY_IS_BINARY ) != 0 ) {
-			fputs( "\tkey: ", outfp );
-			dbtest_bprint( key.data, key.size, "\t      ", outfp );
-		} else if (( options & SLAPI_LDBM_DBTEST_OPT_KEY_IS_ID ) != 0 ) {
-			fprintf( outfp, "\tkey: %ld\n",
-					(u_long)id_stored_to_internal( (char *)key.data ));
-		} else {
-			fprintf( outfp, "\tkey: %s\n", (char *)key.data );
-		}
-		if (( options & SLAPI_LDBM_DBTEST_OPT_DUMPDATA ) != 0 ) {
-			if (( options & SLAPI_LDBM_DBTEST_OPT_DATA_IS_IDLIST ) != 0 ) {
-				fputs( "\tdata: ", outfp );
-				dbtest_print_idlist( (char *)key.dptr, data.data, data.size,
-						outfp );
-			} else if (( options & SLAPI_LDBM_DBTEST_OPT_DATA_IS_BINARY ) != 0 ) {
-				fputs( "\tdata: ", outfp );
-				dbtest_bprint( data.data, data.size, "\t      ", outfp );
-			} else {
-				fprintf( outfp, "\tdata: %s\n", (char *)data.data );
-			}
-		}
-		slapi_ch_free( &(key.data) );
-		slapi_ch_free( &(data.data) );
-	}
-	dbc->c_close(dbc);
-}
-
-static void
-dbtest_print_idlist( char *keystr, void *p,  u_int32_t size, FILE *outfp )
-{
-	IDList	*idl;
-	ID		i;
-
-	idl = (IDList *)p;
-	if ( ALLIDS( idl )) {
-		fputs( "ALLIDS block\n", outfp );
-	} else if ( INDIRECT_BLOCK( idl )) {
-		fputs( "Indirect block)\n", outfp );
-		for ( i = 0; idl->b_ids[i] != NOID; ++i ) {
-			fprintf( outfp, "\t\tkey: %c%s%lu\n", CONT_PREFIX, keystr,
-					(u_long)idl->b_ids[i] );
-		}
-	} else {
-		const char *block_type;
-
-		if ( NULL != keystr && *keystr == CONT_PREFIX ) {
-			block_type = "Continued";
-		} else {
-			block_type = "Regular";
-		}
-		fprintf( outfp, "%s block (count=%lu, max=%lu)\n",
-				block_type, (u_long)idl->b_nids, (u_long)idl->b_nmax );
-		for ( i = 0; i < idl->b_nids; ++i ) {
-			fprintf( outfp, "\t\tid: %lu\n", (u_long)idl->b_ids[i] );
-		}
-	}
-}
-
-
-
-#define BPLEN	48
-
-static void
-dbtest_bprint( char *data, int len, char *lineprefix, FILE *outfp )
-{
-	static char	hexdig[] = "0123456789abcdef";
-	char		out[ BPLEN ], *curprefix;
-	int		i = 0;
-
-	if ( NULL == lineprefix ) {
-		lineprefix = "";
-	}
-	curprefix = "";
-
-	memset( out, 0, BPLEN );
-	for ( ;; ) {
-		if ( len < 1 ) {
-			if ( i > 0 ) {
-				fprintf( outfp, "%s%s\n", curprefix, out );
-			}
-			break;
-		}
-
-#ifndef HEX
-		if ( isgraph( (unsigned char)*data )) {
-			out[ i ] = ' ';
-			out[ i+1 ] = *data;
-		} else {
-#endif
-			out[ i ] = hexdig[ ( *data & 0xf0 ) >> 4 ];
-			out[ i+1 ] = hexdig[ *data & 0x0f ];
-#ifndef HEX
-		}
-#endif
-		i += 2;
-		len--;
-		data++;
-
-		if ( i > BPLEN - 2 ) {
-			fprintf( outfp, "%s%s\n", curprefix, out );
-			curprefix = lineprefix;
-			memset( out, 0, BPLEN );
-			i = 0;
-			continue;
-		}
-		out[ i++ ] = ' ';
-	}
-}

+ 0 - 2
ldap/servers/slapd/back-ldbm/init.c

@@ -239,8 +239,6 @@ ldbm_back_init( Slapi_PBlock *pb )
 	    (void *) dblayer_plugin_abort );
 	rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_SIZE_FN,
 	    (void *) ldbm_db_size );
-	rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_TEST_FN,
-	    (void *) ldbm_back_db_test );
 	rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_INIT_INSTANCE_FN,
 	    (void *) ldbm_back_init ); /* register itself so that the secon instance
                                           can be initialized */

+ 0 - 1
ldap/servers/slapd/back-ldbm/proto-back-ldbm.h

@@ -475,7 +475,6 @@ int ldbm_back_upgradedb( Slapi_PBlock *pb );
 int ldbm_back_dbverify( Slapi_PBlock *pb );
 int ldbm_back_next_search_entry( Slapi_PBlock *pb ); 
 int ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension );
-int ldbm_back_db_test( Slapi_PBlock *pb ); 
 int ldbm_back_entry_release( Slapi_PBlock *pb, void *backend_info_ptr );
 void ldbm_back_search_results_release( void **search_results );
 int ldbm_back_init( Slapi_PBlock *pb ); 

+ 0 - 74
ldap/servers/slapd/main.c

@@ -115,7 +115,6 @@ static int slapd_exemode_db2archive();
 static int slapd_exemode_upgradedb();
 static int slapd_exemode_upgradednformat();
 static int slapd_exemode_dbverify();
-static int slapd_exemode_dbtest();
 static int slapd_exemode_suffix2instance();
 static int slapd_debug_level_string2level( const char *s );
 static void slapd_debug_level_log( int level );
@@ -371,8 +370,6 @@ name2exemode( char *progname, char *s, int exit_if_unknown )
 		exemode = SLAPD_EXEMODE_DB2ARCHIVE;
 	} else if ( strcmp( s, "server" ) == 0 ) {
 		exemode = SLAPD_EXEMODE_SLAPD;
-	} else if ( strcmp( s, "dbtest" ) == 0 ) {
-		exemode = SLAPD_EXEMODE_DBTEST;
 	} else if ( strcmp( s, "db2index" ) == 0 ) {
 		exemode = SLAPD_EXEMODE_DB2INDEX;
 	} else if ( strcmp( s, "refer" ) == 0 ) {
@@ -440,10 +437,6 @@ usage( char *name, char *extraname )
     case SLAPD_EXEMODE_REFERRAL:
 	usagestr = "usage: %s %s%s-D configdir -r referral-url [-p port]\n";
 	break;
-    case SLAPD_EXEMODE_DBTEST:
-	usagestr = "usage: %s %s%s-D configdir -n backend-instance-name "
-		"[-d debuglevel] [-S] [-v]\n";
-	break;
     case SLAPD_EXEMODE_SUFFIX2INSTANCE:
 	usagestr = "usage: %s %s%s -D configdir {-s suffix}*\n";
 	break;
@@ -980,11 +973,6 @@ main( int argc, char **argv)
 		goto cleanup;
 		break;
 
-	case SLAPD_EXEMODE_DBTEST:
-		return_value = slapd_exemode_dbtest();
-		goto cleanup;
-		break;
-		
 	case SLAPD_EXEMODE_REFERRAL:
 		/* check that all the necessary info was given, then go on */
 		if (! config_check_referral_mode()) {
@@ -1340,16 +1328,6 @@ process_command_line(int argc, char **argv, char *myname,
 	 *
 	 */
 
-	char *opts_dbtest = "vd:n:SD:";
-	struct opt_ext long_options_dbtest[] = {
-		{"version",ArgNone,'v'},
-		{"debug",ArgRequired,'d'},
-		{"backend",ArgRequired,'n'},
-		{"allowMultipleProcesses",ArgNone,'S'},
-		{"configDir",ArgRequired,'D'},
-		{0,0,0}};
-	
-	
 	char *opts_db2ldif = "vd:D:ENa:rs:x:CSut:n:UmMo1";
 	struct opt_ext long_options_db2ldif[] = {
 		{"version",ArgNone,'v'},
@@ -1514,10 +1492,6 @@ process_command_line(int argc, char **argv, char *myname,
 
 	/* maintain compatibility with pre-5.x options */
 	switch( slapd_exemode ) {
-	case SLAPD_EXEMODE_DBTEST:
-		opts = opts_dbtest;
-		long_opts = long_options_dbtest;
-		break;
 	case SLAPD_EXEMODE_DB2LDIF:
 		opts = opts_db2ldif;
 		long_opts = long_options_db2ldif;
@@ -1658,7 +1632,6 @@ process_command_line(int argc, char **argv, char *myname,
 		case 'n':	/* which backend to do ldif2db/bak2db for */
 			if (slapd_exemode == SLAPD_EXEMODE_LDIF2DB ||
 				slapd_exemode == SLAPD_EXEMODE_UPGRADEDNFORMAT ||
-				slapd_exemode == SLAPD_EXEMODE_DBTEST ||
 				slapd_exemode == SLAPD_EXEMODE_DB2INDEX ||
 				slapd_exemode == SLAPD_EXEMODE_ARCHIVE2DB) {
 				/* The -n argument will give the name of a backend instance. */
@@ -2858,53 +2831,6 @@ slapd_exemode_dbverify()
 }
 
 
-static int
-slapd_exemode_dbtest()
-{
-    int return_value= 0;
-    Slapi_PBlock pb;
-    struct slapdplugin *plugin;
-
-    if (NULL == cmd_line_instance_name) {
-        LDAPDebug(LDAP_DEBUG_ANY, 
-                  "dbtest: Required argument -n <instance name> missing\n", 0, 0, 0);
-        usage( myname, extraname );
-        return 1;
-    }
-
-    mapping_tree_init();
-
-    plugin = lookup_plugin_by_instance_name(cmd_line_instance_name);
-    if (plugin == NULL) {
-        LDAPDebug(LDAP_DEBUG_ANY, 
-                  "ERROR: Could not find backend '%s'.\n",
-                  cmd_line_instance_name, 0, 0);
-        return 1;
-    }
-
-    /* Make sure we aren't going to run slapd in 
-     * a mode that is going to conflict with other
-     * slapd processes that are currently running
-     */
-    if ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica,
-                               skip_db_protect_check) == -1 )  {
-
-        LDAPDebug( LDAP_DEBUG_ANY, 
-                   "Shutting down due to possible conflicts with other slapd processes\n",
-                   0, 0, 0 );
-        return 1;
-    }
-
-    pb.pb_backend = NULL;
-    pb.pb_plugin = plugin;
-    pb.pb_instance_name = cmd_line_instance_name;
-    /* For dbtest, we do _not_ change identity (no setuid()) */
-    return_value= (*plugin->plg_dbtest)( &pb );
-    return return_value;
-}
-
-
-
 #ifdef LDAP_DEBUG
 /*
  * Table to associate a string with a debug level.

Some files were not shown because too many files changed in this diff