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

Jeremy Allison jra at samba.org
Thu Sep 20 11:31:03 GMT 2007


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.


More information about the samba-technical mailing list