libsmbclient threadsafeness

Igor Belyi sambauser at
Wed Oct 20 19:48:20 GMT 2004

Yea, talking about '*not* Ok functions'... pull_ascii_fstring() is not a 
thread-safe. Just look at the convert_string_allocate() it uses...


Michael B Allen wrote:
> David Wuertele said:
>>This is essentially what I've done, but inline without defining a
>>function.  Since I've done it for every call into libsmbclient
>>already, I'm now going to try backing off things that probably don't
>>need it, like "pull_ascii_fstring()" and the like.
> I know something like this might not look like it has threading problems
> and I don't know anything about this function but there are a lot of ways
> to ruin thread-ability. Consider something like:
> const char *
> pull_foo(void)
>    static char buf[64];
>    ...
>    return buf;
> }
> And this will look like it works until one day you get a foo someone else
> was working on :(

More information about the samba-technical mailing list