summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd
diff options
context:
space:
mode:
Diffstat (limited to 'ldap/servers/slapd')
-rw-r--r--ldap/servers/slapd/back-ldbm/dblayer.c7
-rw-r--r--ldap/servers/slapd/back-ldbm/dbverify.c231
-rw-r--r--ldap/servers/slapd/back-ldbm/init.c2
-rw-r--r--ldap/servers/slapd/back-ldbm/proto-back-ldbm.h1
-rw-r--r--ldap/servers/slapd/main.c98
-rw-r--r--ldap/servers/slapd/pblock.c12
-rw-r--r--ldap/servers/slapd/slap.h13
-rw-r--r--ldap/servers/slapd/slapi-private.h5
-rw-r--r--ldap/servers/slapd/task.c15
9 files changed, 358 insertions, 26 deletions
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index f0631468..287b64c2 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -2522,8 +2522,11 @@ int dblayer_post_close(struct ldbminfo *li, int dbmode)
}
}
#endif
- commit_good_database(priv);
-
+ if (0 == return_value
+ && !((DBLAYER_ARCHIVE_MODE|DBLAYER_EXPORT_MODE) & dbmode)
+ && !priv->dblayer_bad_stuff_happened) {
+ commit_good_database(priv);
+ }
return return_value;
}
diff --git a/ldap/servers/slapd/back-ldbm/dbverify.c b/ldap/servers/slapd/back-ldbm/dbverify.c
new file mode 100644
index 00000000..bd3ec2e0
--- /dev/null
+++ b/ldap/servers/slapd/back-ldbm/dbverify.c
@@ -0,0 +1,231 @@
+/** 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) 2007 Red Hat, Inc.
+ * All rights reserved.
+ * END COPYRIGHT BLOCK **/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* dbverify.c - verify database files */
+
+#include "back-ldbm.h"
+#include "dblayer.h"
+
+static int
+dbverify_ext( ldbm_instance *inst, int verbose )
+{
+ char dbdir[MAXPATHLEN];
+ char *filep = NULL;
+ PRDir *dirhandle = NULL;
+ PRDirEntry *direntry = NULL;
+ backend *be = inst->inst_be;
+ DB *dbp = NULL;
+ int tmplen = 0;
+ int filelen = 0;
+ int rval = 1;
+ int rval_main = 0;
+ struct ldbminfo *li = inst->inst_li;
+ dblayer_private *priv = (dblayer_private*)li->li_dblayer_private;
+ struct dblayer_private_env *pEnv = priv->dblayer_env;
+
+ dbdir[sizeof(dbdir)-1] = '\0';
+ PR_snprintf(dbdir, sizeof(dbdir), "%s/%s", inst->inst_parent_dir_name,
+ inst->inst_dir_name);
+ if ('\0' != dbdir[sizeof(dbdir)-1]) /* overflown */
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
+ "db path too long: %s/%s\n",
+ inst->inst_parent_dir_name, inst->inst_dir_name, 0);
+ return 1;
+ }
+ tmplen = strlen(dbdir);
+ filep = dbdir + tmplen;
+ filelen = sizeof(dbdir) - tmplen;
+
+ /* run dbverify on each each db file */
+ dirhandle = PR_OpenDir(dbdir);
+ if (! dirhandle)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
+ "PR_OpenDir (%s) failed (%d): %s\n",
+ dbdir, PR_GetError(),slapd_pr_strerror(PR_GetError()));
+ return 1;
+ }
+ while (NULL !=
+ (direntry = PR_ReadDir(dirhandle, PR_SKIP_DOT | PR_SKIP_DOT_DOT)))
+ {
+ /* struct attrinfo *ai = NULL; */
+ char *p = NULL;
+ dbp = NULL;
+
+ if (!direntry->name)
+ {
+ break;
+ }
+ if (!strstr(direntry->name, LDBM_FILENAME_SUFFIX)) /* non db file */
+ {
+ continue;
+ }
+ if (sizeof(direntry->name) + 2 > filelen)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
+ "db path too long: %s/%s%s\n",
+ dbdir, direntry->name, 0);
+ continue;
+ }
+ PR_snprintf(filep, filelen, "/%s", direntry->name);
+ rval = db_create(&dbp, pEnv->dblayer_DB_ENV, 0);
+ if (0 != rval)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
+ "Unable to create id2entry db file %d\n", rval);
+ return rval;
+ }
+#define VLVPREFIX "vlv#"
+ if ((0 != strncmp(direntry->name, ID2ENTRY, strlen(ID2ENTRY))) &&
+ (0 != strncmp(direntry->name, VLVPREFIX, strlen(VLVPREFIX))))
+ {
+ rval = dbp->set_flags(dbp, DB_DUP | DB_DUPSORT);
+ if (0 != rval)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
+ "Unable to set DUP flags to db %d\n", rval);
+ return rval;
+ }
+
+ rval = dbp->set_dup_compare(dbp, idl_new_compare_dups);
+ if (0 != rval)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
+ "Unable to set dup_compare to db %d\n", rval);
+ return rval;
+ }
+ }
+#undef VLVPREFIX
+ rval = dbp->verify(dbp, dbdir, NULL, NULL, 0);
+ if (0 == rval)
+ {
+ if (verbose)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
+ "%s: ok\n", dbdir);
+ }
+ }
+ else
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
+ "verify failed(%d): %s\n", rval, dbdir);
+ }
+ rval_main |= rval;
+ *filep = '\0';
+ }
+ PR_CloseDir(dirhandle);
+
+ return rval_main;
+}
+
+int
+ldbm_back_dbverify( Slapi_PBlock *pb )
+{
+ struct ldbminfo *li = NULL;
+ Object *inst_obj = NULL;
+ ldbm_instance *inst = NULL;
+ int verbose = 0;
+ int rval = 1;
+ int rval_main = 0;
+ char **instance_names = NULL;
+
+ slapi_log_error(SLAPI_LOG_TRACE, "verify DB", "Verifying db files...\n");
+ slapi_pblock_get(pb, SLAPI_BACKEND_INSTANCE_NAME, &instance_names);
+ slapi_pblock_get(pb, SLAPI_SEQ_VAL, &verbose);
+ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &li);
+ ldbm_config_load_dse_info(li);
+ ldbm_config_internal_set(li, CONFIG_DB_TRANSACTION_LOGGING, "off");
+ /* no write needed; choose EXPORT MODE */
+ if (0 != dblayer_start(li, DBLAYER_EXPORT_MODE))
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "verify DB",
+ "dbverify: Failed to init database\n");
+ return rval;
+ }
+
+ /* server is up */
+ slapi_log_error(SLAPI_LOG_TRACE, "verify DB", "server is up\n");
+ if (instance_names) /* instance is specified */
+ {
+ char **inp = NULL;
+ for (inp = instance_names; inp && *inp; inp++)
+ {
+ inst = ldbm_instance_find_by_name(li, *inp);
+ if (inst)
+ {
+ rval_main |= dbverify_ext(inst, verbose);
+ }
+ else
+ {
+ rval_main |= 1; /* no such instance */
+ }
+ }
+ }
+ else /* all instances */
+ {
+ for (inst_obj = objset_first_obj(li->li_instance_set); inst_obj;
+ inst_obj = objset_next_obj(li->li_instance_set, inst_obj))
+ {
+ inst = (ldbm_instance *)object_get_data(inst_obj);
+ /* check if an import/restore is already ongoing... */
+ if (instance_set_busy(inst) != 0)
+ {
+ /* standalone, only. never happens */
+ slapi_log_error(SLAPI_LOG_FATAL, "upgrade DB",
+ "ldbm: '%s' is already in the middle of "
+ "another task and cannot be disturbed.\n",
+ inst->inst_name);
+ continue; /* skip this instance and go to the next*/
+ }
+ rval_main |= dbverify_ext(inst, verbose);
+ }
+ }
+
+ /* close the database down again */
+ rval = dblayer_post_close(li, DBLAYER_EXPORT_MODE);
+ if (0 != rval)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL,
+ "verify DB", "Failed to close database\n");
+ }
+
+ return rval_main;
+}
diff --git a/ldap/servers/slapd/back-ldbm/init.c b/ldap/servers/slapd/back-ldbm/init.c
index 66f6d97e..9f138a3e 100644
--- a/ldap/servers/slapd/back-ldbm/init.c
+++ b/ldap/servers/slapd/back-ldbm/init.c
@@ -209,6 +209,8 @@ ldbm_back_init( Slapi_PBlock *pb )
(void *) ldbm_back_ldbm2archive );
rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_UPGRADEDB_FN,
(void *) ldbm_back_upgradedb );
+ rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_DBVERIFY_FN,
+ (void *) ldbm_back_dbverify );
rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_BEGIN_FN,
(void *) dblayer_plugin_begin );
rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_DB_COMMIT_FN,
diff --git a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
index e0c89536..29bcb094 100644
--- a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
@@ -448,6 +448,7 @@ int ldbm_back_ldbm2index( Slapi_PBlock *pb );
int ldbm_back_archive2ldbm( Slapi_PBlock *pb );
int ldbm_back_ldbm2archive( Slapi_PBlock *pb );
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 );
diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c
index 5723db44..ff4b0d84 100644
--- a/ldap/servers/slapd/main.c
+++ b/ldap/servers/slapd/main.c
@@ -112,6 +112,7 @@ static int slapd_exemode_db2index();
static int slapd_exemode_archive2db();
static int slapd_exemode_db2archive();
static int slapd_exemode_upgradedb();
+static int slapd_exemode_dbverify();
static int slapd_exemode_dbtest();
static int slapd_exemode_suffix2instance();
static int slapd_debug_level_string2level( const char *s );
@@ -374,16 +375,16 @@ name2exemode( char *progname, char *s, int exit_if_unknown )
exemode = SLAPD_EXEMODE_REFERRAL;
} else if ( strcmp( s, "suffix2instance" ) == 0 ) {
exemode = SLAPD_EXEMODE_SUFFIX2INSTANCE;
- }
- else if ( strcmp( s, "upgradedb" ) == 0 )
- {
+ } else if ( strcmp( s, "upgradedb" ) == 0 ) {
exemode = SLAPD_EXEMODE_UPGRADEDB;
+ } else if ( strcmp( s, "dbverify" ) == 0 ) {
+ exemode = SLAPD_EXEMODE_DBVERIFY;
}
else if ( exit_if_unknown ) {
fprintf( stderr, "usage: %s -D configdir "
"[ldif2db | db2ldif | archive2db "
"| db2archive | db2index | refer | suffix2instance"
- " | upgradedb] "
+ " | upgradedb | dbverify] "
"[options]\n", progname );
exit( 1 );
} else {
@@ -443,6 +444,9 @@ usage( char *name, char *extraname )
case SLAPD_EXEMODE_UPGRADEDB:
usagestr = "usage: %s %s%s-D configdir [-d debuglevel] [-f] -a archivedir\n";
break;
+ case SLAPD_EXEMODE_DBVERIFY:
+ usagestr = "usage: %s %s%s-D configdir [-d debuglevel] [-n backend-instance-name]\n";
+ break;
default: /* SLAPD_EXEMODE_SLAPD */
usagestr = "usage: %s %s%s-D configdir [-d debuglevel] "
@@ -480,7 +484,8 @@ static char *archive_name = NULL;
static int db2ldif_dump_replica = 0;
static int db2ldif_dump_uniqueid = 1;
static int ldif2db_generate_uniqueid = SLAPI_UNIQUEID_GENERATE_TIME_BASED;
-static int ldif2db_load_state= 1;
+static int ldif2db_load_state = 1;
+static int dbverify_verbose = 0;
static char *ldif2db_namespaceid = NULL;
int importexport_encrypt = 0;
static int upgradedb_force = 0;
@@ -983,6 +988,13 @@ main( int argc, char **argv)
case SLAPD_EXEMODE_UPGRADEDB:
return slapd_exemode_upgradedb();
+ case SLAPD_EXEMODE_DBVERIFY:
+ return_value = slapd_exemode_dbverify();
+ if (return_value == 0)
+ return return_value;
+ else
+ return 1;
+
case SLAPD_EXEMODE_PRINTVERSION:
slapd_print_version(1);
exit(1);
@@ -1368,6 +1380,15 @@ process_command_line(int argc, char **argv, char *myname,
{"configDir",ArgRequired,'D'},
{0,0,0}};
+ char *opts_dbverify = "vVfd:n:D:";
+ struct opt_ext long_options_dbverify[] = {
+ {"version",ArgNone,'v'},
+ {"debug",ArgRequired,'d'},
+ {"backend",ArgRequired,'n'},
+ {"configDir",ArgRequired,'D'},
+ {"verbose",ArgNone,'V'},
+ {0,0,0}};
+
char *opts_referral = "vd:p:r:SD:";
struct opt_ext long_options_referral[] = {
{"version",ArgNone,'v'},
@@ -1464,6 +1485,10 @@ process_command_line(int argc, char **argv, char *myname,
opts = opts_upgradedb;
long_opts = long_options_upgradedb;
break;
+ case SLAPD_EXEMODE_DBVERIFY:
+ opts = opts_dbverify;
+ long_opts = long_options_dbverify;
+ break;
default: /* SLAPD_EXEMODE_SLAPD */
opts = opts_slapd;
long_opts = long_options_slapd;
@@ -1567,7 +1592,8 @@ process_command_line(int argc, char **argv, char *myname,
slapd_exemode == SLAPD_EXEMODE_ARCHIVE2DB) {
/* The -n argument will give the name of a backend instance. */
cmd_line_instance_name = optarg_ext;
- } else if (slapd_exemode == SLAPD_EXEMODE_DB2LDIF) {
+ } else if (slapd_exemode == SLAPD_EXEMODE_DB2LDIF ||
+ slapd_exemode == SLAPD_EXEMODE_DBVERIFY) {
char *s = slapi_ch_strdup(optarg_ext);
charray_add(&cmd_line_instance_names, s);
} else {
@@ -1726,7 +1752,11 @@ process_command_line(int argc, char **argv, char *myname,
break;
case 'V':
- slapd_exemode = SLAPD_EXEMODE_PRINTVERSION;
+ if ( slapd_exemode == SLAPD_EXEMODE_DBVERIFY ) {
+ dbverify_verbose = 1;
+ } else {
+ slapd_exemode = SLAPD_EXEMODE_PRINTVERSION;
+ }
break;
case 'a': /* archive pathname for db */
@@ -2004,7 +2034,7 @@ slapd_exemode_ldif2db()
exit( 1 );
}
- /* this should be the first time this are called! if the init order
+ /* this should be the first time to be called! if the init order
* is ever changed, these lines should be changed (or erased)!
*/
mapping_tree_init();
@@ -2546,7 +2576,7 @@ slapd_exemode_upgradedb()
exit( 1 );
}
- /* this should be the first time this are called! if the init order
+ /* this should be the first time to be called! if the init order
* is ever changed, these lines should be changed (or erased)!
*/
mapping_tree_init();
@@ -2601,10 +2631,58 @@ slapd_exemode_upgradedb()
return( return_value );
}
+/*
+ * function to perform DB verify
+ */
+static int
+slapd_exemode_dbverify()
+{
+ int return_value = 0;
+ Slapi_PBlock pb;
+ struct slapdplugin *backend_plugin;
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+
+ /* this should be the first time to be called! if the init order
+ * is ever changed, these lines should be changed (or erased)!
+ */
+ mapping_tree_init();
+ if ((backend_plugin = plugin_get_by_name("ldbm database")) == NULL) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "ERROR: Could not find the ldbm backend plugin.\n",
+ 0, 0, 0);
+ exit(1);
+ }
+
+ /* check for slapi v2 support */
+ if (! SLAPI_PLUGIN_IS_V2(backend_plugin)) {
+ LDAPDebug(LDAP_DEBUG_ANY, "ERROR: %s is too old to do dbverify.\n",
+ backend_plugin->plg_name, 0, 0);
+ exit(1);
+ }
+
+ memset( &pb, '\0', sizeof(pb) );
+ pb.pb_backend = NULL;
+ pb.pb_seq_val = dbverify_verbose;
+ pb.pb_plugin = backend_plugin;
+ pb.pb_instance_name = (char *)cmd_line_instance_names;
+ pb.pb_task_flags = TASK_RUNNING_FROM_COMMANDLINE;
+
+ if ( backend_plugin->plg_dbverify != NULL ) {
+ return_value = (*backend_plugin->plg_dbverify)( &pb );
+ } else {
+ LDAPDebug( LDAP_DEBUG_ANY,
+ "ERROR: no db verify function defined for "
+ "%s\n", backend_plugin->plg_name, 0, 0 );
+ return_value = -1;
+ }
+
+ return( return_value );
+}
+
static int
slapd_exemode_dbtest()
-{
+{
int return_value= 0;
Slapi_PBlock pb;
struct slapdplugin *plugin;
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
index 2ca642a1..24be1e1b 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -617,6 +617,12 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value )
}
(*(IFP *)value) = pblock->pb_plugin->plg_upgradedb;
break;
+ case SLAPI_PLUGIN_DB_DBVERIFY_FN:
+ if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_DATABASE ) {
+ return( -1 );
+ }
+ (*(IFP *)value) = pblock->pb_plugin->plg_dbverify;
+ break;
case SLAPI_PLUGIN_DB_BEGIN_FN:
if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_DATABASE ) {
return( -1 );
@@ -1886,6 +1892,12 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value )
}
pblock->pb_plugin->plg_upgradedb = (IFP) value;
break;
+ case SLAPI_PLUGIN_DB_DBVERIFY_FN:
+ if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_DATABASE ) {
+ return( -1 );
+ }
+ pblock->pb_plugin->plg_dbverify = (IFP) value;
+ break;
case SLAPI_PLUGIN_DB_BEGIN_FN:
if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_DATABASE ) {
return( -1 );
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 2a9753b0..e62df3a3 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -65,8 +65,9 @@ static char ptokDes[34] = "Internal (Software) Token ";
#define SLAPD_EXEMODE_DB2INDEX 7
#define SLAPD_EXEMODE_REFERRAL 8
#define SLAPD_EXEMODE_SUFFIX2INSTANCE 9
-#define SLAPD_EXEMODE_PRINTVERSION 10
+#define SLAPD_EXEMODE_PRINTVERSION 10
#define SLAPD_EXEMODE_UPGRADEDB 11
+#define SLAPD_EXEMODE_DBVERIFY 12
#ifdef _WIN32
#ifndef DONT_DECLARE_SLAPD_LDAP_DEBUG
@@ -766,14 +767,14 @@ struct slapdplugin {
IFP plg_un_db_flush; /* close */
IFP plg_un_db_seq; /* sequence */
IFP plg_un_db_entry; /* entry send */
- IFP plg_un_db_referral; /* referral send */
+ IFP plg_un_db_referral; /* referral send */
IFP plg_un_db_result; /* result send */
IFP plg_un_db_ldif2db; /* ldif 2 database */
IFP plg_un_db_db2ldif; /* database 2 ldif */
IFP plg_un_db_db2index; /* database 2 index */
- IFP plg_un_db_archive2db; /* ldif 2 database */
- IFP plg_un_db_db2archive; /* database 2 ldif */
- IFP plg_un_db_upgradedb; /* convert old idl to new */
+ IFP plg_un_db_archive2db; /* ldif 2 database */
+ IFP plg_un_db_db2archive; /* database 2 ldif */
+ IFP plg_un_db_upgradedb; /* convert old idl to new */
IFP plg_un_db_begin; /* dbase txn begin */
IFP plg_un_db_commit; /* dbase txn commit */
IFP plg_un_db_abort; /* dbase txn abort */
@@ -784,6 +785,7 @@ struct slapdplugin {
IFP plg_un_db_register_oc_callback; /* Register a function to call when a operation is applied to a given ObjectClass */
IFP plg_un_db_init_instance; /* initializes new db instance */
IFP plg_un_db_wire_import; /* fast replica update */
+ IFP plg_un_db_verify; /* verify db files */
} plg_un_db;
#define plg_bind plg_un.plg_un_db.plg_un_db_bind
#define plg_unbind plg_un.plg_un_db.plg_un_db_unbind
@@ -809,6 +811,7 @@ struct slapdplugin {
#define plg_archive2db plg_un.plg_un_db.plg_un_db_archive2db
#define plg_db2archive plg_un.plg_un_db.plg_un_db_db2archive
#define plg_upgradedb plg_un.plg_un_db.plg_un_db_upgradedb
+#define plg_dbverify plg_un.plg_un_db.plg_un_db_verify
#define plg_dbsize plg_un.plg_un_db.plg_un_db_dbsize
#define plg_dbtest plg_un.plg_un_db.plg_un_db_dbtest
#define plg_rmdb plg_un.plg_un_db.plg_un_db_rmdb
diff --git a/ldap/servers/slapd/slapi-private.h b/ldap/servers/slapd/slapi-private.h
index 848f1019..91828fe0 100644
--- a/ldap/servers/slapd/slapi-private.h
+++ b/ldap/servers/slapd/slapi-private.h
@@ -829,9 +829,10 @@ int valuearray_find(const Slapi_Attr *a, Slapi_Value **va, const Slapi_Value *v)
#define SLAPI_PLUGIN_DB_DB2INDEX_FN 228
#define SLAPI_PLUGIN_DB_NEXT_SEARCH_ENTRY_EXT_FN 229
#define SLAPI_PLUGIN_DB_ENTRY_RELEASE_FN 230
-#define SLAPI_PLUGIN_DB_INIT_INSTANCE_FN 231
-#define SLAPI_PLUGIN_DB_WIRE_IMPORT_FN 234
+#define SLAPI_PLUGIN_DB_INIT_INSTANCE_FN 231
+#define SLAPI_PLUGIN_DB_WIRE_IMPORT_FN 234
#define SLAPI_PLUGIN_DB_UPGRADEDB_FN 235
+#define SLAPI_PLUGIN_DB_DBVERIFY_FN 236
/* database plugin-specific parameters */
#define SLAPI_PLUGIN_DB_NO_ACL 250
#define SLAPI_PLUGIN_DB_RMDB_FN 280
diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c
index f01cf28a..7930cba2 100644
--- a/ldap/servers/slapd/task.c
+++ b/ldap/servers/slapd/task.c
@@ -55,13 +55,13 @@ static PRLock *global_task_lock = NULL;
static int shutting_down = 0;
-#define TASK_BASE_DN "cn=tasks, cn=config"
-#define TASK_IMPORT_DN "cn=import, cn=tasks, cn=config"
-#define TASK_EXPORT_DN "cn=export, cn=tasks, cn=config"
-#define TASK_BACKUP_DN "cn=backup, cn=tasks, cn=config"
-#define TASK_RESTORE_DN "cn=restore, cn=tasks, cn=config"
-#define TASK_INDEX_DN "cn=index, cn=tasks, cn=config"
-#define TASK_UPGRADEDB_DN "cn=upgradedb, cn=tasks, cn=config"
+#define TASK_BASE_DN "cn=tasks, cn=config"
+#define TASK_IMPORT_DN "cn=import, cn=tasks, cn=config"
+#define TASK_EXPORT_DN "cn=export, cn=tasks, cn=config"
+#define TASK_BACKUP_DN "cn=backup, cn=tasks, cn=config"
+#define TASK_RESTORE_DN "cn=restore, cn=tasks, cn=config"
+#define TASK_INDEX_DN "cn=index, cn=tasks, cn=config"
+#define TASK_UPGRADEDB_DN "cn=upgradedb, cn=tasks, cn=config"
#define TASK_LOG_NAME "nsTaskLog"
#define TASK_STATUS_NAME "nsTaskStatus"
@@ -1486,6 +1486,7 @@ task_upgradedb_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter,
}
out:
+ slapi_ch_free((void **)&mypb.pb_seq_val);
if (rv != 0) {
if (task)
destroy_task(1, task);