[PATCH v3] fixes account locked when using winbind refresh tickets

David Mulder dmulder at suse.com
Mon Jan 15 17:24:01 UTC 2018


https://talloc.samba.org/talloc/doc/html/libtalloc__bestpractices.html

My use of talloc_new(), and creating a new ctx for every function is
based on the "best practices" recommendations in the talloc tutorial. If
the recommendations on this page are wrong, then the page should be updated.

On 01/15/2018 10:17 AM, Ralph Böhme wrote:
> On Mon, Jan 15, 2018 at 05:13:38PM +0100, Andreas Schneider via samba-technical wrote:
>> On Monday, 15 January 2018 16:48:02 CET David Disseldorp via samba-technical 
>> wrote:
>>> Hi Andreas,
>>>
>>> On Mon, 15 Jan 2018 16:29:33 +0100, Andreas Schneider via samba-technical 
>> wrote:
>>>> +static uint64_t fetch_last_password_change(struct WINBINDD_CCACHE_ENTRY
>>>> *entry)
>>>> +{
>>>> +	TALLOC_CTX *ctx = talloc_new(entry);
>>>>
>>>> Please use:
>>>> 	TALLOC_CTX *frame = talloc_stackframe();
>>>>
>>>> This is cheaper than talloc_new().
>>> Are there any public real-world benchmark results that show this? In
>>> terms of readability I find the former much easier to follow.
>> Ask Metze or Volker :-)
> I've recently looked into the code and my personal take-away was: if possible,
> avoid both. :) If really needed (for proper run-down of temp objects), use
> talloc_stackframe().
>
> -slow
>

-- 
David Mulder
SUSE Labs Software Engineer - Samba
dmulder at suse.com
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)




More information about the samba-technical mailing list