[PATCH] ldbdump, and thanks for tdbdump -e!

Andrew Bartlett abartlet at samba.org
Mon Oct 29 23:35:47 MDT 2012


On Tue, 2012-10-30 at 01:33 -0400, Scott Lovenberg wrote:
> 
> On Tue, Oct 30, 2012 at 1:25 AM, Andrew Bartlett <abartlet at samba.org>
> wrote:
>         Rusty,
>         
>         I figured you might be interested to see what I've done with
>         the
>         tdb_rescue API you built a few weeks ago.  Still trying to
>         sort out the
>         DB that we worked, I built ldbdump.  It uses the backend
>         ldb_pack
>         functions from ldb_tdb as well as the Samba syntax functions
>         to
>         determine if the potential DB record passed to the hook is a
>         valid ldb
>         record.
>         
>         This eliminated around 12 more records - indeed all the
>         'duplicate'
>         records you found could be eliminated as actually not being
>         valid
>         records at all.
>         
>         Thank you very much for the tdb_rescue API and tdbdump -e, it
>         would not
>         be possible to recover so much of the data without it.
>         
>         Naturally, it will need a manpage and popt conversion before
>         it is
>         installed, but for now it may be the vital tool for some other
>         unfortunate site that forgets to enable barrier=1 on their
>         ext3
>         partitions.
> 
> Silly question, why does traverse_fn() return 0 if ltdb_unpack_data()
> doesn't return 0?  Wouldn't it make sense to propagate the error code
> instead of just outputting to stderr and returning success?

Because we are dealing with a corrupt database, this happens often, and
so we don't wish to terminate the traversal (which is what returning
non-zero indicates).

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list