mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Remove sys/syscall.h, sys/types.h, linux/posix_types.h, sysdep.h and pthread-functions.h includes. Include setxid.h. Use INLINE_SETXID_SYSCALL macro instead of INLINE_SYSCALL, kill the HAVE_PTR__NPTL_SETXID guarded snippets.
This commit is contained in:
@ -18,35 +18,13 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__setregid (gid_t rgid, gid_t egid)
|
__setregid (gid_t rgid, gid_t egid)
|
||||||
{
|
{
|
||||||
int result;
|
return INLINE_SETXID_SYSCALL (setregid, 2, (int) rgid, (int) egid);
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setregid, 2, (signed int)rgid, (signed int)egid);
|
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setregid;
|
|
||||||
cmd.id[0] = rgid;
|
|
||||||
cmd.id[1] = egid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
#ifndef __setregid
|
#ifndef __setregid
|
||||||
weak_alias (__setregid, setregid)
|
weak_alias (__setregid, setregid)
|
||||||
|
@ -18,36 +18,14 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__setresgid (gid_t rgid, gid_t egid, gid_t sgid)
|
__setresgid (gid_t rgid, gid_t egid, gid_t sgid)
|
||||||
{
|
{
|
||||||
int result;
|
return INLINE_SETXID_SYSCALL (setresgid, 3, (int) rgid,
|
||||||
|
(int) egid, (int) sgid);
|
||||||
result = INLINE_SYSCALL (setresgid, 3, (signed int)rgid, (signed int)egid, (signed int)sgid);
|
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setresgid;
|
|
||||||
cmd.id[0] = rgid;
|
|
||||||
cmd.id[1] = egid;
|
|
||||||
cmd.id[2] = sgid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
libc_hidden_def (__setresgid)
|
libc_hidden_def (__setresgid)
|
||||||
#ifndef __setresgid
|
#ifndef __setresgid
|
||||||
|
@ -18,36 +18,14 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__setresuid (uid_t ruid, uid_t euid, uid_t suid)
|
__setresuid (uid_t ruid, uid_t euid, uid_t suid)
|
||||||
{
|
{
|
||||||
int result;
|
return INLINE_SETXID_SYSCALL (setresuid, 3, (int) ruid,
|
||||||
|
(int) euid, (int) suid);
|
||||||
result = INLINE_SYSCALL (setresuid, 3, (signed int)ruid, (signed int)euid, (signed int)suid);
|
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setresuid;
|
|
||||||
cmd.id[0] = ruid;
|
|
||||||
cmd.id[1] = euid;
|
|
||||||
cmd.id[2] = suid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
libc_hidden_def (__setresuid)
|
libc_hidden_def (__setresuid)
|
||||||
#ifndef __setresuid
|
#ifndef __setresuid
|
||||||
|
@ -18,35 +18,13 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__setreuid (uid_t ruid, uid_t euid)
|
__setreuid (uid_t ruid, uid_t euid)
|
||||||
{
|
{
|
||||||
int result;
|
return INLINE_SETXID_SYSCALL (setreuid, 2, (int) ruid, (int) euid);
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setreuid, 2, (signed int)ruid, (signed int)euid);
|
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setreuid;
|
|
||||||
cmd.id[0] = ruid;
|
|
||||||
cmd.id[1] = euid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
#ifndef __setreuid
|
#ifndef __setreuid
|
||||||
weak_alias (__setreuid, setreuid)
|
weak_alias (__setreuid, setreuid)
|
||||||
|
@ -18,11 +18,8 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include "kernel-features.h"
|
#include "kernel-features.h"
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __NR_setresgid
|
#ifdef __NR_setresgid
|
||||||
@ -42,7 +39,7 @@ setegid (gid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if __ASSUME_32BITUIDS > 0
|
#if __ASSUME_32BITUIDS > 0
|
||||||
result = INLINE_SYSCALL (setresgid32, 3, -1, gid, -1);
|
result = INLINE_SETXID_SYSCALL (setresgid32, 3, -1, gid, -1);
|
||||||
#else
|
#else
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
# ifdef __NR_setresgid
|
# ifdef __NR_setresgid
|
||||||
@ -59,18 +56,6 @@ setegid (gid)
|
|||||||
result = __setregid (-1, gid);
|
result = __setregid (-1, gid);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setresgid32;
|
|
||||||
cmd.id[0] = -1;
|
|
||||||
cmd.id[1] = gid;
|
|
||||||
cmd.id[2] = -1;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
libc_hidden_def (setegid)
|
libc_hidden_def (setegid)
|
||||||
|
@ -17,12 +17,9 @@
|
|||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <setxid.h>
|
||||||
#include <sysdep.h>
|
|
||||||
#include "kernel-features.h"
|
#include "kernel-features.h"
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __NR_setresuid
|
#ifdef __NR_setresuid
|
||||||
@ -41,7 +38,7 @@ seteuid (uid_t uid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if __ASSUME_32BITUIDS > 0
|
#if __ASSUME_32BITUIDS > 0
|
||||||
result = INLINE_SYSCALL (setresuid32, 3, -1, uid, -1);
|
result = INLINE_SETXID_SYSCALL (setresuid32, 3, -1, uid, -1);
|
||||||
#else
|
#else
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
# ifdef __NR_setresuid
|
# ifdef __NR_setresuid
|
||||||
@ -58,18 +55,6 @@ seteuid (uid_t uid)
|
|||||||
result = __setreuid (-1, uid);
|
result = __setreuid (-1, uid);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setresuid32;
|
|
||||||
cmd.id[0] = -1;
|
|
||||||
cmd.id[1] = uid;
|
|
||||||
cmd.id[2] = -1;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
libc_hidden_def (seteuid)
|
libc_hidden_def (seteuid)
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
/* Copyright (C) 1998, 2000, 2003, 2004
|
/* Copyright (C) 1998, 2000, 2003, 2004 Free Software Foundation, Inc.
|
||||||
Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -19,15 +18,8 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
|
|
||||||
#include "kernel-features.h"
|
#include "kernel-features.h"
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __NR_setgid32
|
#ifdef __NR_setgid32
|
||||||
@ -44,14 +36,14 @@ __setgid (gid_t gid)
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
#if __ASSUME_32BITUIDS > 0
|
#if __ASSUME_32BITUIDS > 0
|
||||||
result = INLINE_SYSCALL (setgid32, 1, gid);
|
result = INLINE_SETXID_SYSCALL (setgid32, 1, gid);
|
||||||
#else
|
#else
|
||||||
# ifdef __NR_setgid32
|
# ifdef __NR_setgid32
|
||||||
if (__libc_missing_32bit_uids <= 0)
|
if (__libc_missing_32bit_uids <= 0)
|
||||||
{
|
{
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setgid32, 1, gid);
|
result = INLINE_SETXID_SYSCALL (setgid32, 1, gid);
|
||||||
|
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
goto out;
|
goto out;
|
||||||
@ -70,22 +62,12 @@ __setgid (gid_t gid)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setgid, 1, gid);
|
result = INLINE_SETXID_SYSCALL (setgid, 1, gid);
|
||||||
# ifdef __NR_setgid32
|
# ifdef __NR_setgid32
|
||||||
out:
|
out:
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setgid32;
|
|
||||||
cmd.id[0] = gid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#ifndef __setgid
|
#ifndef __setgid
|
||||||
|
@ -17,15 +17,9 @@
|
|||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <setxid.h>
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
#include "kernel-features.h"
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __NR_setregid32
|
#ifdef __NR_setregid32
|
||||||
@ -42,14 +36,14 @@ __setregid (gid_t rgid, gid_t egid)
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
#if __ASSUME_32BITUIDS > 0
|
#if __ASSUME_32BITUIDS > 0
|
||||||
result = INLINE_SYSCALL (setregid32, 2, rgid, egid);
|
result = INLINE_SETXID_SYSCALL (setregid32, 2, rgid, egid);
|
||||||
#else
|
#else
|
||||||
# ifdef __NR_setregid32
|
# ifdef __NR_setregid32
|
||||||
if (__libc_missing_32bit_uids <= 0)
|
if (__libc_missing_32bit_uids <= 0)
|
||||||
{
|
{
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setregid32, 2, rgid, egid);
|
result = INLINE_SETXID_SYSCALL (setregid32, 2, rgid, egid);
|
||||||
|
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
goto out;
|
goto out;
|
||||||
@ -67,23 +61,12 @@ __setregid (gid_t rgid, gid_t egid)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setregid, 2, rgid, egid);
|
result = INLINE_SETXID_SYSCALL (setregid, 2, rgid, egid);
|
||||||
# ifdef __NR_setregid32
|
# ifdef __NR_setregid32
|
||||||
out:
|
out:
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setregid32;
|
|
||||||
cmd.id[0] = rgid;
|
|
||||||
cmd.id[1] = egid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#ifndef __setregid
|
#ifndef __setregid
|
||||||
|
@ -18,14 +18,8 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
#include "kernel-features.h"
|
#include "kernel-features.h"
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
#if defined __NR_setresgid || defined __NR_setresgid32
|
#if defined __NR_setresgid || defined __NR_setresgid32
|
||||||
@ -44,14 +38,14 @@ __setresgid (gid_t rgid, gid_t egid, gid_t sgid)
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
# if __ASSUME_32BITUIDS > 0 || !defined __NR_setresgid
|
# if __ASSUME_32BITUIDS > 0 || !defined __NR_setresgid
|
||||||
result = INLINE_SYSCALL (setresgid32, 3, rgid, egid, sgid);
|
result = INLINE_SETXID_SYSCALL (setresgid32, 3, rgid, egid, sgid);
|
||||||
# else
|
# else
|
||||||
# ifdef __NR_setresgid32
|
# ifdef __NR_setresgid32
|
||||||
if (__libc_missing_32bit_uids <= 0)
|
if (__libc_missing_32bit_uids <= 0)
|
||||||
{
|
{
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setresgid32, 3, rgid, egid, sgid);
|
result = INLINE_SETXID_SYSCALL (setresgid32, 3, rgid, egid, sgid);
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
goto out;
|
goto out;
|
||||||
if (errno != ENOSYS)
|
if (errno != ENOSYS)
|
||||||
@ -70,24 +64,12 @@ __setresgid (gid_t rgid, gid_t egid, gid_t sgid)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setresgid, 3, rgid, egid, sgid);
|
result = INLINE_SETXID_SYSCALL (setresgid, 3, rgid, egid, sgid);
|
||||||
# ifdef __NR_setresgid32
|
# ifdef __NR_setresgid32
|
||||||
out:
|
out:
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setresgid32;
|
|
||||||
cmd.id[0] = rgid;
|
|
||||||
cmd.id[1] = egid;
|
|
||||||
cmd.id[2] = sgid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
libc_hidden_def (__setresgid)
|
libc_hidden_def (__setresgid)
|
||||||
|
@ -18,14 +18,8 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
#include "kernel-features.h"
|
#include "kernel-features.h"
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
#if defined __NR_setresuid || defined __NR_setresuid32
|
#if defined __NR_setresuid || defined __NR_setresuid32
|
||||||
@ -44,14 +38,14 @@ __setresuid (uid_t ruid, uid_t euid, uid_t suid)
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
# if __ASSUME_32BITUIDS > 0 || !defined __NR_setresuid
|
# if __ASSUME_32BITUIDS > 0 || !defined __NR_setresuid
|
||||||
result = INLINE_SYSCALL (setresuid32, 3, ruid, euid, suid);
|
result = INLINE_SETXID_SYSCALL (setresuid32, 3, ruid, euid, suid);
|
||||||
# else
|
# else
|
||||||
# ifdef __NR_setresuid32
|
# ifdef __NR_setresuid32
|
||||||
if (__libc_missing_32bit_uids <= 0)
|
if (__libc_missing_32bit_uids <= 0)
|
||||||
{
|
{
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setresuid32, 3, ruid, euid, suid);
|
result = INLINE_SETXID_SYSCALL (setresuid32, 3, ruid, euid, suid);
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
goto out;
|
goto out;
|
||||||
if (errno != ENOSYS)
|
if (errno != ENOSYS)
|
||||||
@ -70,24 +64,12 @@ __setresuid (uid_t ruid, uid_t euid, uid_t suid)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setresuid, 3, ruid, euid, suid);
|
result = INLINE_SETXID_SYSCALL (setresuid, 3, ruid, euid, suid);
|
||||||
# ifdef __NR_setresuid32
|
# ifdef __NR_setresuid32
|
||||||
out:
|
out:
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setresuid32;
|
|
||||||
cmd.id[0] = ruid;
|
|
||||||
cmd.id[1] = euid;
|
|
||||||
cmd.id[2] = suid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
libc_hidden_def (__setresuid)
|
libc_hidden_def (__setresuid)
|
||||||
|
@ -17,15 +17,9 @@
|
|||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <setxid.h>
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
#include "kernel-features.h"
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __NR_setreuid32
|
#ifdef __NR_setreuid32
|
||||||
@ -42,14 +36,14 @@ __setreuid (uid_t ruid, uid_t euid)
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
#if __ASSUME_32BITUIDS > 0
|
#if __ASSUME_32BITUIDS > 0
|
||||||
result = INLINE_SYSCALL (setreuid32, 2, ruid, euid);
|
result = INLINE_SETXID_SYSCALL (setreuid32, 2, ruid, euid);
|
||||||
#else
|
#else
|
||||||
# ifdef __NR_setreuid32
|
# ifdef __NR_setreuid32
|
||||||
if (__libc_missing_32bit_uids <= 0)
|
if (__libc_missing_32bit_uids <= 0)
|
||||||
{
|
{
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setreuid32, 2, ruid, euid);
|
result = INLINE_SETXID_SYSCALL (setreuid32, 2, ruid, euid);
|
||||||
|
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
goto out;
|
goto out;
|
||||||
@ -67,23 +61,12 @@ __setreuid (uid_t ruid, uid_t euid)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setreuid, 2, ruid, euid);
|
result = INLINE_SETXID_SYSCALL (setreuid, 2, ruid, euid);
|
||||||
# ifdef __NR_setreuid32
|
# ifdef __NR_setreuid32
|
||||||
out:
|
out:
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setreuid32;
|
|
||||||
cmd.id[0] = ruid;
|
|
||||||
cmd.id[1] = euid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#ifndef __setreuid
|
#ifndef __setreuid
|
||||||
|
@ -18,14 +18,8 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
#include "kernel-features.h"
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __NR_setuid32
|
#ifdef __NR_setuid32
|
||||||
@ -42,14 +36,14 @@ __setuid (uid_t uid)
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
#if __ASSUME_32BITUIDS > 0 && defined __NR_setuid32
|
#if __ASSUME_32BITUIDS > 0 && defined __NR_setuid32
|
||||||
result = INLINE_SYSCALL (setuid32, 1, uid);
|
result = INLINE_SETXID_SYSCALL (setuid32, 1, uid);
|
||||||
#else
|
#else
|
||||||
# ifdef __NR_setuid32
|
# ifdef __NR_setuid32
|
||||||
if (__libc_missing_32bit_uids <= 0)
|
if (__libc_missing_32bit_uids <= 0)
|
||||||
{
|
{
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setuid32, 1, uid);
|
result = INLINE_SETXID_SYSCALL (setuid32, 1, uid);
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
goto out;
|
goto out;
|
||||||
if (errno != ENOSYS)
|
if (errno != ENOSYS)
|
||||||
@ -67,22 +61,12 @@ __setuid (uid_t uid)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setuid, 1, uid);
|
result = INLINE_SETXID_SYSCALL (setuid, 1, uid);
|
||||||
# ifdef __NR_setuid32
|
# ifdef __NR_setuid32
|
||||||
out:
|
out:
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setuid32;
|
|
||||||
cmd.id[0] = uid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#ifndef __setuid
|
#ifndef __setuid
|
||||||
|
@ -17,13 +17,9 @@
|
|||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/syscall.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <setxid.h>
|
||||||
#include <sysdep.h>
|
|
||||||
#include "kernel-features.h"
|
#include "kernel-features.h"
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
#if defined __NR_setresgid || __ASSUME_SETRESGID_SYSCALL > 0
|
#if defined __NR_setresgid || __ASSUME_SETRESGID_SYSCALL > 0
|
||||||
@ -42,10 +38,10 @@ setegid (gid_t gid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# if __ASSUME_32BITUIDS > 0 && defined __NR_setresgid32
|
# if __ASSUME_32BITUIDS > 0 && defined __NR_setresgid32
|
||||||
result = INLINE_SYSCALL (setresgid32, 3, -1, gid, -1);
|
result = INLINE_SETXID_SYSCALL (setresgid32, 3, -1, gid, -1);
|
||||||
# else
|
# else
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
result = INLINE_SYSCALL (setresgid, 3, -1, gid, -1);
|
result = INLINE_SETXID_SYSCALL (setresgid, 3, -1, gid, -1);
|
||||||
# if __ASSUME_SETRESGID_SYSCALL == 0
|
# if __ASSUME_SETRESGID_SYSCALL == 0
|
||||||
if (result == -1 && errno == ENOSYS)
|
if (result == -1 && errno == ENOSYS)
|
||||||
/* No system call available. Use emulation. This may not work
|
/* No system call available. Use emulation. This may not work
|
||||||
@ -55,22 +51,6 @@ setegid (gid_t gid)
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
# ifdef __NR_setresgid32
|
|
||||||
cmd.syscall_no = __NR_setresgid32;
|
|
||||||
# else
|
|
||||||
cmd.syscall_no = __NR_setresgid;
|
|
||||||
# endif
|
|
||||||
cmd.id[0] = -1;
|
|
||||||
cmd.id[1] = gid;
|
|
||||||
cmd.id[2] = -1;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#ifndef setegid
|
#ifndef setegid
|
||||||
|
@ -17,13 +17,9 @@
|
|||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/syscall.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <setxid.h>
|
||||||
#include <sysdep.h>
|
|
||||||
#include "kernel-features.h"
|
#include "kernel-features.h"
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
#if defined __NR_setresuid || __ASSUME_SETRESUID_SYSCALL > 0
|
#if defined __NR_setresuid || __ASSUME_SETRESUID_SYSCALL > 0
|
||||||
@ -42,10 +38,10 @@ seteuid (uid_t uid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# if __ASSUME_32BITUIDS > 0 && defined __NR_setresuid32
|
# if __ASSUME_32BITUIDS > 0 && defined __NR_setresuid32
|
||||||
result = INLINE_SYSCALL (setresuid32, 3, -1, uid, -1);
|
result = INLINE_SETXID_SYSCALL (setresuid32, 3, -1, uid, -1);
|
||||||
# else
|
# else
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
result = INLINE_SYSCALL (setresuid, 3, -1, uid, -1);
|
result = INLINE_SETXID_SYSCALL (setresuid, 3, -1, uid, -1);
|
||||||
# if __ASSUME_SETRESUID_SYSCALL == 0
|
# if __ASSUME_SETRESUID_SYSCALL == 0
|
||||||
if (result == -1 && errno == ENOSYS)
|
if (result == -1 && errno == ENOSYS)
|
||||||
/* No system call available. Use emulation. This may not work
|
/* No system call available. Use emulation. This may not work
|
||||||
@ -55,22 +51,6 @@ seteuid (uid_t uid)
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
# ifdef __NR_setresuid32
|
|
||||||
cmd.syscall_no = __NR_setresuid32;
|
|
||||||
# else
|
|
||||||
cmd.syscall_no = __NR_setresuid;
|
|
||||||
# endif
|
|
||||||
cmd.id[0] = -1;
|
|
||||||
cmd.id[1] = uid;
|
|
||||||
cmd.id[2] = -1;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#ifndef seteuid
|
#ifndef seteuid
|
||||||
|
@ -18,35 +18,13 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__setgid (gid_t gid)
|
__setgid (gid_t gid)
|
||||||
{
|
{
|
||||||
int result;
|
return INLINE_SETXID_SYSCALL (setgid, 1, gid);
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setgid, 1, gid);
|
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setgid;
|
|
||||||
cmd.id[0] = gid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
#ifndef __setgid
|
#ifndef __setgid
|
||||||
weak_alias (__setgid, setgid)
|
weak_alias (__setgid, setgid)
|
||||||
|
@ -18,35 +18,13 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__setregid (gid_t rgid, gid_t egid)
|
__setregid (gid_t rgid, gid_t egid)
|
||||||
{
|
{
|
||||||
int result;
|
return INLINE_SETXID_SYSCALL (setregid, 2, rgid, egid);
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setregid, 2, rgid, egid);
|
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setregid;
|
|
||||||
cmd.id[0] = rgid;
|
|
||||||
cmd.id[1] = egid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
#ifndef __setregid
|
#ifndef __setregid
|
||||||
weak_alias (__setregid, setregid)
|
weak_alias (__setregid, setregid)
|
||||||
|
@ -18,37 +18,15 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__setresgid (gid_t rgid, gid_t egid, gid_t sgid)
|
__setresgid (gid_t rgid, gid_t egid, gid_t sgid)
|
||||||
{
|
{
|
||||||
int result;
|
return INLINE_SETXID_SYSCALL (setresgid, 3, rgid, egid, sgid);
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setresgid, 3, rgid, egid, sgid);
|
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setresgid;
|
|
||||||
cmd.id[0] = rgid;
|
|
||||||
cmd.id[1] = egid;
|
|
||||||
cmd.id[2] = sgid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
libc_hidden_def (__setresgid)
|
||||||
#ifndef __setresgid
|
#ifndef __setresgid
|
||||||
weak_alias (__setresgid, setresgid)
|
weak_alias (__setresgid, setresgid)
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,37 +18,15 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__setresuid (uid_t ruid, uid_t euid, uid_t suid)
|
__setresuid (uid_t ruid, uid_t euid, uid_t suid)
|
||||||
{
|
{
|
||||||
int result;
|
return INLINE_SETXID_SYSCALL (setresuid, 3, ruid, euid, suid);
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setresuid, 3, ruid, euid, suid);
|
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setresuid;
|
|
||||||
cmd.id[0] = ruid;
|
|
||||||
cmd.id[1] = euid;
|
|
||||||
cmd.id[2] = suid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
libc_hidden_def (__setresuid)
|
||||||
#ifndef __setresuid
|
#ifndef __setresuid
|
||||||
weak_alias (__setresuid, setresuid)
|
weak_alias (__setresuid, setresuid)
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,35 +18,13 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__setreuid (uid_t ruid, uid_t euid)
|
__setreuid (uid_t ruid, uid_t euid)
|
||||||
{
|
{
|
||||||
int result;
|
return INLINE_SETXID_SYSCALL (setreuid, 2, ruid, euid);
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setreuid, 2, ruid, euid);
|
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setreuid;
|
|
||||||
cmd.id[0] = ruid;
|
|
||||||
cmd.id[1] = euid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
#ifndef __setreuid
|
#ifndef __setreuid
|
||||||
weak_alias (__setreuid, setreuid)
|
weak_alias (__setreuid, setreuid)
|
||||||
|
@ -18,34 +18,12 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <setxid.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <linux/posix_types.h>
|
|
||||||
#include "kernel-features.h"
|
|
||||||
#include <pthread-functions.h>
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__setuid (uid_t uid)
|
__setuid (uid_t uid)
|
||||||
{
|
{
|
||||||
int result;
|
return INLINE_SETXID_SYSCALL (setuid, 1, uid);
|
||||||
|
|
||||||
result = INLINE_SYSCALL (setuid, 1, uid);
|
|
||||||
|
|
||||||
#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD
|
|
||||||
if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL)
|
|
||||||
{
|
|
||||||
struct xid_command cmd;
|
|
||||||
cmd.syscall_no = __NR_setuid;
|
|
||||||
cmd.id[0] = uid;
|
|
||||||
__libc_pthread_functions.ptr__nptl_setxid (&cmd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
#ifndef __setuid
|
#ifndef __setuid
|
||||||
weak_alias (__setuid, setuid)
|
weak_alias (__setuid, setuid)
|
||||||
|
Reference in New Issue
Block a user