diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-20 18:40:32 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-20 11:18:35 +0200 |
commit | 61867eaa8458431c452352df021169c100fa9188 (patch) | |
tree | e2e50b8623f619329170fcbf070b2dff35ef7b8e /source3/lib | |
parent | 4823262439bc6c1ce9fcce97ed472ad44e85cb77 (diff) | |
download | samba-61867eaa8458431c452352df021169c100fa9188.tar.gz samba-61867eaa8458431c452352df021169c100fa9188.tar.bz2 samba-61867eaa8458431c452352df021169c100fa9188.zip |
tdb_validate: TDB2 support for tdb_validate_child and tdb_backup.
We don't expose freelist or hash size for TDB2.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/tdb_validate.c | 12 |
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) { |