svn commit: samba r21736 - in branches/SAMBA_4_0: source/auth/credentials source/lib/ldb/common testprogs/blackbox

simo idra at samba.org
Fri Mar 9 21:23:54 GMT 2007


On Sat, 2007-03-10 at 08:14 +1100, Andrew Bartlett wrote:
> On Fri, 2007-03-09 at 15:43 -0500, simo wrote:
> > On Sat, 2007-03-10 at 07:39 +1100, Andrew Bartlett wrote:
> > > On Fri, 2007-03-09 at 09:16 -0500, simo wrote:
> > > > On Wed, 2007-03-07 at 04:20 +0000, abartlet at samba.org wrote:
> > > > > Author: abartlet
> > > > > Date: 2007-03-07 04:20:10 +0000 (Wed, 07 Mar 2007)
> > > > > New Revision: 21736
> > > > > 
> > > > > WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21736
> > > > > 
> > > > > Log:
> > > > > Fix the smbclient test to do something more interesting with the last
> > > > > few authentication tests.  Now that the tests correctly 'fail', I was
> > > > > able to fix the credentials subsystem to honour USER and PASSWD.
> > > > > 
> > > > > To get --machine-pass working, I needed ldb to always load it's static
> > > > > modules, so I put this in ldb_connect().
> > > > 
> > > > [..]
> > > > 
> > > > > Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
> > > > > ===================================================================
> > > > > --- branches/SAMBA_4_0/source/lib/ldb/common/ldb.c	2007-03-07 03:10:30 UTC (rev 21735)
> > > > > +++ branches/SAMBA_4_0/source/lib/ldb/common/ldb.c	2007-03-07 04:20:10 UTC (rev 21736)
> > > > > @@ -232,6 +232,9 @@
> > > > >  {
> > > > >  	int ret;
> > > > >  
> > > > > +	/* We seem to need to do this here, or else some utilities don't get ldb backends */
> > > > > +	ldb_global_init();
> > > > > +
> > > > >  	ldb->flags = flags;
> > > > >  
> > > > >  	ret = ldb_connect_backend(ldb, url, options, &ldb->modules);
> > > > > 
> > > > 
> > > > Andrew I think this is wrong, can you revert?
> > > > the init must be done in the client application, it is how it has been
> > > > architected, moving it into ldb.c is not the right thing to do.
> > > 
> > > Why is it wrong?  Where would you suggest putting the init, particularly
> > > in apps that don't event know they are using ldb?
> > 
> > What kind of apps don't know they are using ldb?
> > Surely there is something calling into ldb.
> 
> Both ntlm_auth and smbclient got caught because they call credentials
> code, which calls ldb.  Neither app 'knows' that the credentials code
> happens to be implemented in terms of ldb, and so doesn't do anything
> special.
> 
> Should I be calling ldb_global_init() on every ldb-related credentials
> operation, just in case?  What harm does having ldb initialise it's own
> statically compiled back-ends cause?

I have to recheck the code, I remember we didn't put the init code in
ldb.c for a reason, but I forgot the reason :-)
It may even be that the original reason is not true anymore, but that
have to be assessed before doing the change.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org
http://samba.org



More information about the samba-technical mailing list