Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update.
	* sysdeps/unix/sysv/linux/setegid.c [HAVE_PTR__NPTL_SETXID]: Call
	callback to set IDs in all other threads as well.
	* sysdeps/unix/sysv/linux/seteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setegid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/seteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setreuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setreuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/setuid.c: New file.
	* sysdeps/unix/sysv/linux/setgid.c: New file.
	* sysdeps/unix/sysv/linux/setreuid.c: New file.
	* sysdeps/unix/sysv/linux/setregid.c: New file.
	* sysdeps/unix/sysv/linux/setresuid.c: New file.
	* sysdeps/unix/sysv/linux/setresgid.c: New file.
	* sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NCS.
	* sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c: Use x86 version.
	* sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Remove setresgid
	and setresuid.
	* nscd/aicache.c: Use pthread_seteuid_np instead of seteuid.
	* nscd/grpcache.c: Likewise.
	* nscd/hstcache.c: Likewise.
	* nscd/pwdcache.c: Likewise.
  • Loading branch information
Ulrich Drepper committed Sep 20, 2004
1 parent 29e1132 commit 2edb61e
Show file tree
Hide file tree
Showing 62 changed files with 1,252 additions and 233 deletions.
33 changes: 33 additions & 0 deletions ChangeLog
@@ -1,5 +1,38 @@
2004-09-19 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/setegid.c [HAVE_PTR__NPTL_SETXID]: Call
callback to set IDs in all other threads as well.
* sysdeps/unix/sysv/linux/seteuid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setegid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/seteuid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setgid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setuid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setreuid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setreuid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise.
* sysdeps/unix/sysv/linux/setuid.c: New file.
* sysdeps/unix/sysv/linux/setgid.c: New file.
* sysdeps/unix/sysv/linux/setreuid.c: New file.
* sysdeps/unix/sysv/linux/setregid.c: New file.
* sysdeps/unix/sysv/linux/setresuid.c: New file.
* sysdeps/unix/sysv/linux/setresgid.c: New file.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NCS.
* sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c: Use x86 version.
* sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Remove setresgid
and setresuid.
* nscd/aicache.c: Use pthread_seteuid_np instead of seteuid.
* nscd/grpcache.c: Likewise.
* nscd/hstcache.c: Likewise.
* nscd/pwdcache.c: Likewise.

* resolv/res_mkquery.c (res_nmkquery): Fix typo.

2004-09-18 Ulrich Drepper <drepper@redhat.com>
Expand Down
22 changes: 22 additions & 0 deletions linuxthreads/ChangeLog
@@ -1,3 +1,25 @@
2004-09-19 Ulrich Drepper <drepper@redhat.com>

* sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
and pthread_setresuid_np.
* pthread_setgid_np.c: New file.
* pthread_setuid_np.c: New file.
* pthread_setegid_np.c: New file.
* pthread_seteuid_np.c: New file.
* pthread_setregid_np.c: New file.
* pthread_setreuid_np.c: New file.
* pthread_setresgid_np.c: New file.
* pthread_setresuid_np.c: New file.
* Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
and pthread_setresuid_np.
* Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
pthread_setregid, and pthread_setresgid.

2004-09-12 Ulrich Drepper <drepper@redhat.com>

* sysdeps/pthread/pthread.h: Make rwlock prototypes available also
Expand Down
6 changes: 5 additions & 1 deletion linuxthreads/Makefile
Expand Up @@ -51,7 +51,11 @@ libpthread-routines := attr cancel condvar join manager mutex ptfork \
ptw-open ptw-open64 ptw-pause ptw-pread ptw-pread64 \
ptw-pwrite ptw-pwrite64 ptw-tcdrain ptw-wait \
ptw-waitpid pt-system old_pthread_atfork pthread_atfork \
ptcleanup
ptcleanup \
pthread_setuid pthread_seteuid pthread_setreuid \
pthread_setresuid \
pthread_setgid pthread_setegid pthread_setregid \
pthread_setresgid
# Don't generate deps for calls with no sources. See sysdeps/unix/Makefile.
omit-deps = $(unix-syscalls:%=ptw-%)

Expand Down
6 changes: 6 additions & 0 deletions linuxthreads/Versions
Expand Up @@ -172,6 +172,12 @@ libpthread {
pthread_cond_wait; pthread_cond_timedwait;
pthread_cond_signal; pthread_cond_broadcast;
}
GLIBC_2.3.4 {
pthread_setuid_np; pthread_seteuid_np; pthread_setreuid_np;
pthread_setresuid_np;
pthread_setgid_np; pthread_setegid_np; pthread_setregid_np;
pthread_setresgid_np;
}
GLIBC_PRIVATE {
# Internal libc interface to libpthread
__pthread_initialize;
Expand Down
27 changes: 27 additions & 0 deletions linuxthreads/pthread_setegid.c
@@ -0,0 +1,27 @@
/* Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <pthread.h>
#include <unistd.h>


int
pthread_setegid_np (gid_t gid)
{
return setegid (gid);
}
27 changes: 27 additions & 0 deletions linuxthreads/pthread_seteuid.c
@@ -0,0 +1,27 @@
/* Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <pthread.h>
#include <unistd.h>


int
pthread_seteuid_np (uid_t uid)
{
return seteuid (uid);
}
27 changes: 27 additions & 0 deletions linuxthreads/pthread_setgid.c
@@ -0,0 +1,27 @@
/* Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <pthread.h>
#include <unistd.h>


int
pthread_setgid_np (gid_t gid)
{
return setgid (gid);
}
27 changes: 27 additions & 0 deletions linuxthreads/pthread_setregid.c
@@ -0,0 +1,27 @@
/* Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <pthread.h>
#include <unistd.h>


int
pthread_setregid_np (gid_t rgid, gid_t egid)
{
return setregid (rgid, egid);
}
27 changes: 27 additions & 0 deletions linuxthreads/pthread_setresgid.c
@@ -0,0 +1,27 @@
/* Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <pthread.h>
#include <unistd.h>


int
pthread_setresgid_np (gid_t rgid, gid_t egid, gid_t sgid)
{
return setresgid (rgid, egid, sgid);
}
27 changes: 27 additions & 0 deletions linuxthreads/pthread_setresuid.c
@@ -0,0 +1,27 @@
/* Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <pthread.h>
#include <unistd.h>


int
pthread_setresuid_np (uid_t ruid, uid_t euid, uid_t suid)
{
return setresuid (ruid, euid, suid);
}
27 changes: 27 additions & 0 deletions linuxthreads/pthread_setreuid.c
@@ -0,0 +1,27 @@
/* Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <pthread.h>
#include <unistd.h>


int
pthread_setreuid_np (uid_t ruid, uid_t euid)
{
return setreuid (ruid, euid);
}
27 changes: 27 additions & 0 deletions linuxthreads/pthread_setuid.c
@@ -0,0 +1,27 @@
/* Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <pthread.h>
#include <unistd.h>


int
pthread_setuid_np (uid_t uid)
{
return setuid (uid);
}
30 changes: 30 additions & 0 deletions linuxthreads/sysdeps/pthread/pthread.h
Expand Up @@ -681,6 +681,36 @@ extern int pthread_atfork (void (*__prepare) (void),

extern void pthread_kill_other_threads_np (void) __THROW;


#ifdef __USE_GNU
/* Change UID of calling thread. */
extern int pthread_setuid_np (__uid_t __uid) __THROW;

/* Change effective UID of calling thread. */
extern int pthread_seteuid_np (__uid_t __uid) __THROW;

/* Change real and effective UID of calling thread. */
extern int pthread_setreuid_np (__uid_t __ruid, __uid_t __euid) __THROW;

/* Change real, effective, and saved UID of calling thread. */
extern int pthread_setresuid_np (__uid_t __ruid, __uid_t __euid,
__uid_t __suid) __THROW;


/* Change GID of calling thread. */
extern int pthread_setgid_np (__gid_t __gid) __THROW;

/* Change effective GID of calling thread. */
extern int pthread_setegid_np (__gid_t __gid) __THROW;

/* Change real and effective GID of calling thread. */
extern int pthread_setregid_np (__gid_t __rgid, __gid_t __egid) __THROW;

/* Change real, effective, and saved GID of calling thread. */
extern int pthread_setresgid_np (__gid_t __rgid, __gid_t __egid,
__gid_t __sgid) __THROW;
#endif

__END_DECLS

#endif /* pthread.h */
34 changes: 34 additions & 0 deletions nptl/ChangeLog
@@ -1,3 +1,37 @@
2004-09-19 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
internal use.
* allocatestack.c (__nptl_setxid): New function.
* descr.h (struct xid_command): Define type.
* init.c (pthread_functions): Add ptr__nptl_setxid initialization.
(sighandler_setxid): New function.
(__pthread_initialize_minimal): Register sighandler_setxid for
SIGCANCEL.
* pt-allocrtsig.c: Update comment.
* pthreadP.h: Define SIGSETXID. Declare __xidcmd variable.
Declare __nptl_setxid.
* sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
* sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
and pthread_setresuid_np.
* pthread_setgid_np.c: New file.
* pthread_setuid_np.c: New file.
* pthread_setegid_np.c: New file.
* pthread_seteuid_np.c: New file.
* pthread_setregid_np.c: New file.
* pthread_setreuid_np.c: New file.
* pthread_setresgid_np.c: New file.
* pthread_setresuid_np.c: New file.
* Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
and pthread_setresuid_np.
* Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
pthread_setregid, and pthread_setresgid.

2004-09-18 Ulrich Drepper <drepper@redhat.com>

* allocatestack.c (allocate_stack): Return EAGAIN instead of
Expand Down

0 comments on commit 2edb61e

Please sign in to comment.