summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-12-20 16:14:23 +0100
committerStefan Metzmacher <metze@samba.org>2013-02-05 08:55:09 +0100
commit71247ec4bdefb3a1b16619f7ea7404bcbafb5b60 (patch)
tree4b7abac8361cd34ae08786658266d8e2664c45b8 /lib
parent1436107b0769c88e7eb50057b5f05ad5b8573990 (diff)
downloadsamba-71247ec4bdefb3a1b16619f7ea7404bcbafb5b60.tar.gz
samba-71247ec4bdefb3a1b16619f7ea7404bcbafb5b60.tar.bz2
samba-71247ec4bdefb3a1b16619f7ea7404bcbafb5b60.zip
tdb: Pass argument "header" to check_header_hash
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/tdb/common/open.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c
index 6079463945..6630d64eac 100644
--- a/lib/tdb/common/open.c
+++ b/lib/tdb/common/open.c
@@ -144,11 +144,12 @@ static void null_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, con
}
static bool check_header_hash(struct tdb_context *tdb,
+ struct tdb_header *header,
bool default_hash, uint32_t *m1, uint32_t *m2)
{
tdb_header_hash(tdb, m1, m2);
- if (tdb->header.magic1_hash == *m1 &&
- tdb->header.magic2_hash == *m2) {
+ if (header->magic1_hash == *m1 &&
+ header->magic2_hash == *m2) {
return true;
}
@@ -161,7 +162,7 @@ static bool check_header_hash(struct tdb_context *tdb,
tdb->hash_fn = tdb_jenkins_hash;
else
tdb->hash_fn = tdb_old_hash;
- return check_header_hash(tdb, false, m1, m2);
+ return check_header_hash(tdb, header, false, m1, m2);
}
_PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
@@ -387,7 +388,8 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td
if ((tdb->header.magic1_hash == 0) && (tdb->header.magic2_hash == 0)) {
/* older TDB without magic hash references */
tdb->hash_fn = tdb_old_hash;
- } else if (!check_header_hash(tdb, !hash_fn, &magic1, &magic2)) {
+ } else if (!check_header_hash(tdb, &tdb->header, !hash_fn,
+ &magic1, &magic2)) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: "
"%s was not created with %s hash function we are using\n"
"magic1_hash[0x%08X %s 0x%08X] "