1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
* sysdeps/unix/sysv/linux/seteuid.c (seteuid): Use setresuid32
	syscall directly if possible.  If __ASSUME_SETRESUID_SYSCALL is
	defined drop compatibility code.
	* sysdeps/unix/sysv/linux/setegid.c (setegid): Use setresgid32
	syscall directly if possible.  If __ASSUME_SETRESUID_SYSCALL is
	defined drop compatibility code.
	* sysdeps/unix/sysv/linux/i386/seteuid.c (seteuid): Use
	setresuid32 syscall directly if possible.
	* sysdeps/unix/sysv/linux/i386/setegid.c (setegid): Use
	setresgid32 syscall directly if possible.
This commit is contained in:
Ulrich Drepper
2003-06-08 22:37:53 +00:00
parent f0da6a7d5a
commit eae59a5681
7 changed files with 86 additions and 16 deletions

View File

@ -44,7 +44,7 @@ __setregid (gid_t rgid, gid_t egid)
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (setresgid32, 3, rgid, egid, -1);
#else
# ifdef __NR_setregid32
# ifdef __NR_setresgid32
if (__libc_missing_32bit_uids <= 0)
{
int result;
@ -66,7 +66,13 @@ __setregid (gid_t rgid, gid_t egid)
return -1;
}
return INLINE_SYSCALL (setresgid, 3, rgid, egid, -1);
# ifdef __NR_setresgid
int result = INLINE_SYSCALL (setresgid, 3, rgid, egid, -1);
# endif
if (result == -1 && errno == ENOSYS)
result = INLINE_SYSCALL (setregid, 2, rgid, egid);
return result;
#endif
}
weak_alias (__setregid, setregid)