[PATCH] selftest: Print error message when smbd does not have ADS support

Andreas Schneider asn at samba.org
Wed Jul 24 00:50:47 MDT 2013


On Thursday 18 July 2013 16:55:31 Christof Schmitt wrote:
> On Thu, Jul 04, 2013 at 09:51:20AM +1000, Andrew Bartlett wrote:
> > On Wed, 2013-07-03 at 13:09 -0700, Christof Schmitt wrote:
> > > When smbd cannot be compiled with ADS support, setting up the s3member
> > > environment fails with:
> > > 
> > > Can't use string ("UNKNOWN") as a HASH ref while "strict refs" in use at
> > > /home/cschmit/test/samba/selftest/selftest.pl line 852.
> > > 
> > > Add an explicit error message for the missing ADS support to make this
> > > easier to debug.
> > > 
> > > Signed-off-by: Christof Schmitt <christof.schmitt at us.ibm.com>
> > > ---
> > > 
> > >  selftest/target/Samba3.pm |    1 +
> > >  1 files changed, 1 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
> > > index 26f5e92..20587bf 100755
> > > --- a/selftest/target/Samba3.pm
> > > +++ b/selftest/target/Samba3.pm
> > > @@ -25,6 +25,7 @@ sub have_ads($) {
> > > 
> > >  	close IN;
> > >  	
> > >  	# If we were not built with ADS support, pretend we were never even
> > >  	available> > 
> > > +	print "smbd does not have ADS support\n" unless $found_ads;
> > > 
> > >  	return $found_ads;
> > >  
> > >  }
> > 
> > While this is good, we should also have a line like this at line 919
> > 
> > 		} elsif ($envvars eq "UNKNOWN") {
> > 
> > and never deference the magic marker as a hash.
> 
> The dereference happens some lines before that. Attached is an updated
> version of the patch that also avoid the invalid hash dereference.

Looks fine for me.

Reviewed-by: Andreas Schneider <asn at samba.org>


Andrew if you're fine with it too please add my review to the commit and push 
it.

-- 
Andreas Schneider                   GPG-ID: F33E3FC6
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list