From: Ralph Boehme Date: Sun, 9 Jul 2017 16:39:27 +0000 (+0200) Subject: tdb: fix tbdtool list freelist output X-Git-Tag: tdb-1.3.15~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a43affd4c509246f968d7003e1b674f92d75d930;p=thirdparty%2Fsamba.git tdb: fix tbdtool list freelist output Due to the non-fixable bug in the BUCKET macro tdbtool list printed some other hash chainlist, not the freelist. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12888 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/lib/tdb/common/dump.c b/lib/tdb/common/dump.c index 5f6a78b2c8e..73286b87350 100644 --- a/lib/tdb/common/dump.c +++ b/lib/tdb/common/dump.c @@ -62,7 +62,11 @@ static int tdb_dump_chain(struct tdb_context *tdb, int i) { tdb_off_t rec_ptr, top; - top = TDB_HASH_TOP(i); + if (i == -1) { + top = FREELIST_TOP; + } else { + top = TDB_HASH_TOP(i); + } if (tdb_lock(tdb, i, F_WRLCK) != 0) return -1;