diff options
Diffstat (limited to 'src/unistd')
-rw-r--r-- | src/unistd/setegid.c | 4 | ||||
-rw-r--r-- | src/unistd/seteuid.c | 4 | ||||
-rw-r--r-- | src/unistd/setgid.c | 2 | ||||
-rw-r--r-- | src/unistd/setregid.c | 2 | ||||
-rw-r--r-- | src/unistd/setresgid.c | 2 | ||||
-rw-r--r-- | src/unistd/setresuid.c | 2 | ||||
-rw-r--r-- | src/unistd/setreuid.c | 2 | ||||
-rw-r--r-- | src/unistd/setuid.c | 2 |
8 files changed, 12 insertions, 8 deletions
diff --git a/src/unistd/setegid.c b/src/unistd/setegid.c index 85348842..e6da2573 100644 --- a/src/unistd/setegid.c +++ b/src/unistd/setegid.c @@ -1,6 +1,8 @@ #include <unistd.h> +#include "libc.h" +#include "syscall.h" int setegid(gid_t egid) { - return setregid(-1, egid); + return __setxid(SYS_setresgid, -1, egid, -1); } diff --git a/src/unistd/seteuid.c b/src/unistd/seteuid.c index 0aaa86e0..ef8b9df4 100644 --- a/src/unistd/seteuid.c +++ b/src/unistd/seteuid.c @@ -1,6 +1,8 @@ #include <unistd.h> +#include "syscall.h" +#include "libc.h" int seteuid(uid_t euid) { - return setreuid(-1, euid); + return __setxid(SYS_setresuid, -1, euid, -1); } diff --git a/src/unistd/setgid.c b/src/unistd/setgid.c index 87b2717e..bae4616a 100644 --- a/src/unistd/setgid.c +++ b/src/unistd/setgid.c @@ -4,5 +4,5 @@ int setgid(gid_t gid) { - return __rsyscall(SYS_setgid, gid, 0, 0, 0, 0, 0); + return __setxid(SYS_setgid, gid, 0, 0); } diff --git a/src/unistd/setregid.c b/src/unistd/setregid.c index 665b5556..f5a8972a 100644 --- a/src/unistd/setregid.c +++ b/src/unistd/setregid.c @@ -4,5 +4,5 @@ int setregid(gid_t rgid, gid_t egid) { - return __rsyscall(SYS_setregid, rgid, egid, 0, 0, 0, 0); + return __setxid(SYS_setregid, rgid, egid, 0); } diff --git a/src/unistd/setresgid.c b/src/unistd/setresgid.c index 9b9fe50b..b9af540a 100644 --- a/src/unistd/setresgid.c +++ b/src/unistd/setresgid.c @@ -5,5 +5,5 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid) { - return __rsyscall(SYS_setresgid, rgid, egid, sgid, 0, 0, 0); + return __setxid(SYS_setresgid, rgid, egid, sgid); } diff --git a/src/unistd/setresuid.c b/src/unistd/setresuid.c index 497f7592..83692b4c 100644 --- a/src/unistd/setresuid.c +++ b/src/unistd/setresuid.c @@ -5,5 +5,5 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid) { - return __rsyscall(SYS_setresuid, ruid, euid, suid, 0, 0, 0); + return __setxid(SYS_setresuid, ruid, euid, suid); } diff --git a/src/unistd/setreuid.c b/src/unistd/setreuid.c index 93d68c03..3fcc59e2 100644 --- a/src/unistd/setreuid.c +++ b/src/unistd/setreuid.c @@ -4,5 +4,5 @@ int setreuid(uid_t ruid, uid_t euid) { - return __rsyscall(SYS_setreuid, ruid, euid, 0, 0, 0, 0); + return __setxid(SYS_setreuid, ruid, euid, 0); } diff --git a/src/unistd/setuid.c b/src/unistd/setuid.c index e778c7f3..602ecbbf 100644 --- a/src/unistd/setuid.c +++ b/src/unistd/setuid.c @@ -4,5 +4,5 @@ int setuid(uid_t uid) { - return __rsyscall(SYS_setuid, uid, 0, 0, 0, 0, 0); + return __setxid(SYS_setuid, uid, 0, 0); } |