diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-03-17 00:22:05 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-03-17 00:22:05 +0000 |
commit | 1dcd6be8c6cc918288d483c117271fc3db53b62a (patch) | |
tree | 1a12379af49ca2f4511982dc7bba2753657641ce /libexec/ld.so/powerpc | |
parent | c9687eaa307d461d9af0e5fd16d741bbde32eee3 (diff) |
Clean up the zapping of bad variables. Instead of implementing
_dl_suid_ok, just use the issetugid syscall.
ok drahn@.
Diffstat (limited to 'libexec/ld.so/powerpc')
-rw-r--r-- | libexec/ld.so/powerpc/syscall.h | 66 |
1 files changed, 3 insertions, 63 deletions
diff --git a/libexec/ld.so/powerpc/syscall.h b/libexec/ld.so/powerpc/syscall.h index eccc62229fa..d539e591e65 100644 --- a/libexec/ld.so/powerpc/syscall.h +++ b/libexec/ld.so/powerpc/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.4 2002/02/21 23:17:53 drahn Exp $ */ +/* $OpenBSD: syscall.h,v 1.5 2002/03/17 00:22:04 art Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -216,56 +216,8 @@ _dl_stat (const char *addr, struct stat *sb) #endif -/* Not an actual syscall, but we need something in assembly to say - whether this is OK or not. */ - -static inline int -_dl_getuid () -{ - register int status __asm__ ("3"); - __asm__ volatile ("mr 0,%1\n\t" - "sc\n\t" - "cmpwi 0, 0\n\t" - "beq 1f\n\t" - "li 3,-1\n\t" - "1:" - : "=r" (status) - : "r" (SYS_getuid) - : "0", "3"); - return status; -} -static inline int -_dl_geteuid () -{ - register int status __asm__ ("3"); - __asm__ volatile ("mr 0,%1\n\t" - "sc\n\t" - "cmpwi 0, 0\n\t" - "beq 1f\n\t" - "li 3,-1\n\t" - "1:" - : "=r" (status) - : "r" (SYS_geteuid) - : "0", "3"); - return status; -} -static inline int -_dl_getgid () -{ - register int status __asm__ ("3"); - __asm__ volatile ("mr 0,%1\n\t" - "sc\n\t" - "cmpwi 0, 0\n\t" - "beq 1f\n\t" - "li 3,-1\n\t" - "1:" - : "=r" (status) - : "r" (SYS_getgid) - : "0", "3"); - return status; -} static inline int -_dl_getegid () +_dl_issetugid() { register int status __asm__ ("3"); __asm__ volatile ("mr 0,%1\n\t" @@ -275,21 +227,9 @@ _dl_getegid () "li 3,-1\n\t" "1:" : "=r" (status) - : "r" (SYS_getgid) + : "r" (SYS_issetugid) : "0", "3"); return status; } -static inline int -_dl_suid_ok (void) -{ - unsigned int uid, euid, gid, egid; - - uid = _dl_getuid(); - euid = _dl_geteuid(); - gid = _dl_getgid(); - egid = _dl_getegid(); - return (uid == euid && gid == egid); -} - #include <elf_abi.h> #endif /*__DL_SYSCALL_H__*/ |