nss_winbind is not thread safe, any suggestions to fix this?

boyang yyyeer.bo at gmail.com
Thu Sep 20 12:30:15 GMT 2007


Jeremy Allison wrote:
> On Thu, Sep 20, 2007 at 04:25:55AM -0700, Jeremy Allison wrote:
>   
>>> I have enlarged the time ticks to explain the race condition situation.
>>> Generally speaking, the response of the two request in corresponding thread can
>>> be messed. request 1 get the response of request2 and request2 get the response
>>> of request1.
>>>       
>> Yes, if we export a _r function we must ensure it's thread-safe, even
>> if we merely add a 'global' mutex around the call.
>>     
>
> Following on, we should add a global mutex #if HAVE_PTHREAD
> and wrap all the _r functions in a pthread_mutex_lock/pthread_mutex_unlock
> pair. That's the fix (IMHO) as we're not internally thread safe.
>
> Jeremy.
>
>   
    Allison, Thanks for your guidance.
    I'll work on it tomorrow, since it is quite late in my country now.

best
      regards
boyang
9.21



More information about the samba-technical mailing list