Patchset to add asynchronous open/close to master
jra at samba.org
Wed Jun 20 18:42:13 MDT 2012
On Wed, Jun 20, 2012 at 05:25:33PM -0700, Jeremy Allison wrote:
> What this means is that WE ALREADY DEPEND (at least on Linux)
> on pthreads having a different effective uid from their parent
> thread, and deliberately select USE_SETREUID in our waf and
> autoconf configure tests on Linux, as using that function
> doesn't change the euid or egid of Linux spawned pthreads :-).
> So if this is true, I can make the aio_open call be a Linux-only
> part of the module, and just remove the fixup code as the spawned
> thread can never be raced :-). I'm ok with that BTW (Linux is
> our primary platform after all).
> I'll do some more investigation. But watch this space.. :-).
What I'm planning is to write some test code that
checks if on modern glibc systems that setreuid()
only changes the euid/egid of the specific thread
it is called from, and if so we're already good
for the aio open code.
If (as appears possible now I've looked at the
glibc code) they have changed this to cause
setreuid() to do the SETXID signalling (which
is what glibc uses internally to request individual
threads change their own uid/gids) then we will
need to change source3/lib/util_sec.c to use
the raw system setreuid() system call directly
instead of going through the glibc wrapper, in
order to keep the same functionalty we are
already depending on in Linux.
I'll report back once I've tested things more.
More information about the samba-technical