[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Wed Jul 16 03:21:20 MDT 2014


ping?

On 2014-07-10 at 01:24 +0200, Michael Adam wrote:
> Hi Andrew,
> 
> since I just looked at this in bugzilla, one question:
> 
> On 2014-04-02 at 02:37 +0200, Jeremy Allison wrote:
> > The branch, master has been updated
> >        ...
> >        via  bc5bd40 libsmb: Provide a talloc_stackframe() to external users of libsmb_setget.c
> >        ...
> > 
> > http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> 
> In this commit:
> 
> > - Log -----------------------------------------------------------------
> > commit bc5bd4010e8fedf19047ed6f7a793cd373f9f14f
> > Author: Andrew Bartlett <abartlet at samba.org>
> > Date:   Mon Mar 31 10:19:58 2014 +1300
> > 
> >     libsmb: Provide a talloc_stackframe() to external users of libsmb_setget.c
> >     
> >     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
> >     Reviewed-by: Jeremy Allison <jra at samba.org>
> 
> Isn't this hunk superfluous?
> 
> > diff --git a/source3/libsmb/libsmb_setget.c b/source3/libsmb/libsmb_setget.c
> > index b8adcca..3255b52 100644
> > --- a/source3/libsmb/libsmb_setget.c
> > +++ b/source3/libsmb/libsmb_setget.c
> >  /**
> > @@ -498,7 +507,11 @@ smbc_setOptionUseNTHash(SMBCCTX *c, smbc_bool b)
> >  smbc_get_auth_data_fn
> >  smbc_getFunctionAuthData(SMBCCTX *c)
> >  {
> > -        return c->callbacks.auth_fn;
> > +	smbc_get_auth_data_fn ret;
> > +	TALLOC_CTX *frame = talloc_stackframe();
> > +	ret = c->callbacks.auth_fn;
> > +	TALLOC_FREE(frame);
> > +	return ret;
> >  }
> >  
> >  /** Set the function for obtaining authentication data */
> 
> Just returning a variable doesn't require a talloc stackframe,
> or what am I missing?
> 
> Feel free to push the attached patch to revert this part.
> 
> Looking at the code, I get the impression that the other
> hunks are not needed either currently, but these
> call functions and those may change, and I see the point there.
> 
> Cheers - Michael

> From a9260f65462dfdb99ef4035fe561253bf3cebcec Mon Sep 17 00:00:00 2001
> From: Michael Adam <obnox at samba.org>
> Date: Thu, 10 Jul 2014 01:09:56 +0200
> Subject: [PATCH] libsmb: no stackframe required for just returning a variable
> 
> simplify smbc_getFunctionAuthData() again, sparing a talloc stackframe.
> 
> This partly reverts bc5bd4010e8fedf19047ed6f7a793cd373f9f14f.
> 
> Signed-off-by: Michael Adam <obnox at samba.org>
> ---
>  source3/libsmb/libsmb_setget.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/source3/libsmb/libsmb_setget.c b/source3/libsmb/libsmb_setget.c
> index 3255b52..ea8676f 100644
> --- a/source3/libsmb/libsmb_setget.c
> +++ b/source3/libsmb/libsmb_setget.c
> @@ -507,11 +507,7 @@ smbc_setOptionUseNTHash(SMBCCTX *c, smbc_bool b)
>  smbc_get_auth_data_fn
>  smbc_getFunctionAuthData(SMBCCTX *c)
>  {
> -	smbc_get_auth_data_fn ret;
> -	TALLOC_CTX *frame = talloc_stackframe();
> -	ret = c->callbacks.auth_fn;
> -	TALLOC_FREE(frame);
> -	return ret;
> +	return c->callbacks.auth_fn;
>  }
>  
>  /** Set the function for obtaining authentication data */
> -- 
> 1.9.1
> 



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140716/0021336b/attachment.pgp>


More information about the samba-technical mailing list