ldbdump is a vaulable tool and should be retained.

Andrew Tridgell tridge at samba.org
Tue Oct 30 23:33:04 MDT 2012

Hi Simo,

I don't think exposing ltdb_pack_data() was so terrible, but given you
would prefer another approach Andrew and I have put one together in my
ldbdump-review branch.


It makes the patch quite a bit larger, but is more consistent with other
calls, such as those in ldb_parse.c. There isn't really anything
specific to ldb_tdb about the ldb_pack.c code, it was only in ldb_tdb/
as there happened to be no other users. It could be used by any record
based ldb backend.

One disadvantage of this alternative approach is that it adds an
assumption that TDB_DATA and struct ldb_val are the same shape, in the
same way we currently assume that struct ldb_val and DATA_BLOB are the
same shape. We could instead re-build the structures each time, but I
don't think that is worthwhile.

The ldbdump utility looks to be very useful for database recovery, and I
don't think we can really build it without adding some linkage between
the pack/unpack record oriented routines and outside tools. Given that
ldbdump is a ldb internal tool doing that via including ldb_tdb.h was
not unreasonable I think, but if you prefer the above approach instead
then I'd be happy with either way.

Cheers, Tridge

More information about the samba-technical mailing list