This is the mail archive of the mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.

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


Hash: SHA1

I implemented finally an especially horrible part of POSIX: setXid
affecting the whole process.  The kernel people refuse to add support so
we have to do it at userlevel.  It is implemented by integrated over the
threads in the process, sending a signal, and having the signal handler
make the system call.

There is no error checking aside from the calling thread's call.  If
this call succeeds all others better succeed, too.  Otherwise the
programmer screwed up the process' state or the system is faulty.

To achieve this functionality the libc's setXid functions had to be
extended.  What previously had been a simple syscall is not a function
which calls the libpthread callback if it exists.  I cleaned up
(hopefully) the sparc code a bit.  The result is tested on x86, x86-64,
and ppc64.  ppc32 and ia64 should work, too.

The other archs need some love.  I introduced a new macro
INTERNAL_SYSCALL_NCS which is just like INTERNAL_SYSCALL, but the first
parameter can be a non-constant value.  I.e., INTERNAL_SYSCALL can be a
wrapper which simply adds __NR_ to the first parameter.  This needs to
be done for all archs supporting nptl.

The previous functionality of setXid was useful, as could be seen in
nscd.  Support for this functionality is now provided by a set of new
functions pthread_setXid_np.  I have decided not to get
pthread_getXid_np functions since they are only good for symmetry.  A
thread can only query its own IDs, not that of the mystical "process".
But I added the interfaces to LinuxThreads as well, mainly to help nscd.
 With LT setXid and pthread_setXid_np are equivalent.

Since the incorrect old setXid behavior was documented there is no need
to provide compatibility for programs which expect setXid to change only
the threads permissions.  This has always been wrong so screw those who
rely on it.  They'll have to change.  We have not lost any functionality
so this is not problematic.

- --
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
Version: GnuPG v1.2.6 (GNU/Linux)


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