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

Jeremy Allison jra at samba.org
Fri Sep 28 16:24:58 GMT 2007


On Fri, Sep 28, 2007 at 11:51:47PM +0800, boyang wrote:
> Jeremy Allison wrote:
> > On Fri, Sep 28, 2007 at 11:49:47AM +0800, boyang wrote:
> >   
> >> hi, Allison:
> >>      1. Could you explain the reason of renaming keep_response? I cannot
> >> see any difference except it becomes more clear after the renaming.  In
> >> my opinion, keep_response works properly without renaming them.
> >>     
> >
> > No, it doesn't. It's actually a bug. A 'static int x' has file
> > scope in C. All those variables were actually redefinitions of
> > the same thing.
> >   
> hi, Allison:
>     I think I cannot agree with you. the "static int keep_response" is
> defined in functions, and it actually has function scope.
> when gcc(4.1, the version of gcc I used) compile it, it will define
> different symbols for each variable in different functions and those
> symbols have different values(ie, different address, different memory). 
> Take  keep_response as an example: actually in the binary file, four
> different symbols are defined for keep_response. And it is the same for
> response(static struct winbindd_response response)
> which are defined in functions.

Ok, you're probably right on this (been looking for C standard spec).

I missed the 'static struct winbindd_response response' anyway :-).

I may change back before I commit.

Thanks,

	Jeremy.


More information about the samba-technical mailing list