ldb: Change ltdb_unpack_data to take an ldb_context

simo idra at samba.org
Tue Oct 30 21:57:25 MDT 2012


On Wed, 2012-10-31 at 14:53 +1100, Andrew Bartlett wrote:
> On Tue, 2012-10-30 at 20:59 -0400, simo wrote:
> > On Tue, 2012-10-30 at 23:57 +0100, Andrew Bartlett wrote:
> > > commit cc6d0decc7980028293168aee267e7610752fc80
> > > Author: Andrew Bartlett <abartlet at samba.org>
> > > Date:   Tue Oct 30 10:21:42 2012 +1100
> > > 
> > >     ldb: Change ltdb_unpack_data to take an ldb_context
> > >     
> > >     It always de-references the module to find the ldb anyway.
> > >     
> > >     Andrew Bartlett 
> > 
> > Andrew,
> > why are you messing over with these interface conventions ?
> > 
> > I see no rationale for this change, can you please revert and learn a
> > bit about consistent and predictable interfaces ?
> 
> This interface is private to the ldb_tdb backend, but is used by ldbdump
> to recover badly damaged ldb files.  It was much easier to change this
> than to fake up a struct ldb_module only to de-reference it again to get
> at the ldb_context. 

Faking up a module context would give you the same nack.
ldb_tdb functions are private to libldb, if you want to do the correct
thing you add a recovery function to the libldb abstraction and then
have a ldb_tdb implementation that internally calls tbd traverse and
ltdb unpack.

That is the correct way to introduce this functionality, and if you
asked I would have gladly pointed it out.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list