summaryrefslogtreecommitdiff
path: root/libexec/ld.so/alpha
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-03-17 00:22:05 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-03-17 00:22:05 +0000
commit1dcd6be8c6cc918288d483c117271fc3db53b62a (patch)
tree1a12379af49ca2f4511982dc7bba2753657641ce /libexec/ld.so/alpha
parentc9687eaa307d461d9af0e5fd16d741bbde32eee3 (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/alpha')
-rw-r--r--libexec/ld.so/alpha/ldasm.S26
-rw-r--r--libexec/ld.so/alpha/syscall.h24
2 files changed, 6 insertions, 44 deletions
diff --git a/libexec/ld.so/alpha/ldasm.S b/libexec/ld.so/alpha/ldasm.S
index 609a1b1ac81..5fea7c60807 100644
--- a/libexec/ld.so/alpha/ldasm.S
+++ b/libexec/ld.so/alpha/ldasm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldasm.S,v 1.4 2001/09/24 21:37:06 art Exp $ */
+/* $OpenBSD: ldasm.S,v 1.5 2002/03/17 00:22:04 art Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
@@ -258,29 +258,11 @@ LEAF_NOPROFILE(_dl_mprotect, 3)
RET
END(_dl_mprotect)
-LEAF_NOPROFILE(_dl_getuid, 0)
- ldiq v0, SYS_getuid
+LEAF_NOPROFILE(_dl_issetugid, 0)
+ ldiq v0, SYS_issetugid
call_pal PAL_OSF1_callsys
RET
-END(_dl_getuid)
-
-LEAF_NOPROFILE(_dl_geteuid, 0)
- ldiq v0, SYS_geteuid
- call_pal PAL_OSF1_callsys
- RET
-END(_dl_geteuid)
-
-LEAF_NOPROFILE(_dl_getgid, 0)
- ldiq v0, SYS_getgid
- call_pal PAL_OSF1_callsys
- RET
-END(_dl_getgid)
-
-LEAF_NOPROFILE(_dl_getegid, 0)
- ldiq v0, SYS_getegid
- call_pal PAL_OSF1_callsys
- RET
-END(_dl_getegid)
+END(_dl_issetugid)
#ifdef USE_CACHE
LEAF_NOPROFILE(_dl_stat, 2)
diff --git a/libexec/ld.so/alpha/syscall.h b/libexec/ld.so/alpha/syscall.h
index ace18414da3..06f257da9b5 100644
--- a/libexec/ld.so/alpha/syscall.h
+++ b/libexec/ld.so/alpha/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) 2001 Niklas Hallqvist
@@ -46,10 +46,7 @@
int _dl_close(int);
int _dl_exit(int);
-int _dl_getegid(void);
-int _dl_geteuid(void);
-int _dl_getgid(void);
-int _dl_getuid(void);
+int _dl_issetugid(void);
long _dl_mmap(void *, unsigned int, unsigned int, unsigned int, int, off_t);
int _dl_mprotect(const void *, int, int);
int _dl_munmap(const void*, unsigned int);
@@ -60,22 +57,5 @@ int _dl_stat(const char *, struct stat *);
#endif
int _dl_write(int, const char*, int);
-/*
- * Not an actual syscall, but we need something in assembly to say
- * whether this is OK or not.
- */
-
-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__*/