[PATCH] Add stackframes to public libsmbclient functions

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Nov 19 15:51:37 GMT 2007

On Mon, Nov 19, 2007 at 10:38:37AM -0500, Derrell Lipman wrote:
> > Can you please then provide some hints how to solve the
> >
> > DEBUG(10, ("sid: %s\n", sid_string_static(sid)));
> >
> > problem? sid_string_static using a static variable is much
> > worse than passing a magic talloc ctx in my opinion. Or
> > should we go back to using those?
> I don't have any problem with providing a talloc context; I just don't
> like it being "magic".  If a context is needed, it should be passed as
> a parameter, I think.  Am I missing something, or do you just not like
> the concept of passing it as a parameter?

The problem is that the above 1-liner would turn into

	TALLOC_CTX *ctx = talloc_init("bla");
	DEBUG(10, ("sid: %s\n", sid_string_talloc(ctx, sid)));

There are very many functions that right now do not have
their own temporary talloc context but which want to use
some sid_string_static equivalent functions. All of these
would have to add the temporary talloc context that can be
passed to sid_string_talloc. Overall this is much more
clutter than having the talloc stackframes at well-defined
layers. And as libsmbclient.c is the central gateway into the
lower-level cli_whatever functions I think this is the right

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20071119/932fb0eb/attachment.bin

More information about the samba-technical mailing list