This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using thread-specific credentials on Linux in Samba with glibc.


On Mon, Jul 02, 2012 at 11:04:24PM +0530, Siddhesh Poyarekar wrote:
> Thanks for the context. It looks like there are a couple of questions
> in that. I've forwarded this to libc-alpha since a lot of maintainers
> are more active there and would be able to pitch in (and hence the top
> post to preserve your response).
> 
> * Stability of the syscall() function API: I think this should be easy
> to guarantee since glibc strives to remain backward compatible. The
> only trouble is the thread local nature of errno, which seems to tied
> in to the pthread implementation. The syscall function behaviour has
> been what it is since I've used it, which has been a couple of years
> at least.
> 
> * Thread local errno: If you have threads created and maintained by
> nptl then your errno will be thread-local and hence you won't clobber
> the value across threads.

Yes, we are using the pthread api for our threads. Using this
(and having one central place for our credentials wrappers)
means if any other systems add the credentials-per-thread
functionality (I'm thinking *BSD or Solaris/Nexenta/Ilumos)
then we have portability.

> I guess the clone() call example was just that and is not related to
> this question, but if you have in fact been using clone to get your
> threads and not nptl then I think you will in fact have a problem with
> errno getting clobbered. the syscall() is not related here though,
> since calling setresuid directly will also cause the clobbering.

Yes, the clone() example isn't related to the real question, it
was just being used to make a point there.

Thanks !

Jeremy.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]