summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/tdb_validate.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/lib/tdb_validate.c b/source3/lib/tdb_validate.c
index 210d91eeb0..617160ee86 100644
--- a/source3/lib/tdb_validate.c
+++ b/source3/lib/tdb_validate.c
@@ -57,6 +57,7 @@ static int tdb_validate_child(struct tdb_context *tdb,
goto out;
}
+#ifndef BUILD_TDB2
/* Check if the tdb's freelist is good. */
if (tdb_validate_freelist(tdb, &num_entries) == -1) {
v_status.bad_freelist = True;
@@ -66,6 +67,7 @@ static int tdb_validate_child(struct tdb_context *tdb,
DEBUG(10,("tdb_validate_child: tdb %s freelist has %d entries\n",
tdb_name(tdb), num_entries));
+#endif
/* Now traverse the tdb to validate it. */
num_entries = tdb_traverse(tdb, validate_fn, (void *)&v_status);
@@ -289,8 +291,14 @@ static int tdb_backup(TALLOC_CTX *ctx, const char *src_path,
}
unlink(tmp_path);
- dst_tdb = tdb_open_log(tmp_path,
- hash_size ? hash_size : tdb_hash_size(src_tdb),
+
+#ifndef BUILD_TDB2
+ if (!hash_size) {
+ hash_size = tdb_hash_size(src_tdb);
+ }
+#endif
+
+ dst_tdb = tdb_open_log(tmp_path, hash_size,
TDB_DEFAULT, O_RDWR | O_CREAT | O_EXCL,
st.st_mode & 0777);
if (dst_tdb == NULL) {