diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-06-03 09:28:08 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-06-03 09:28:08 +0000 |
commit | c2fb2246377abfbc5f46f868da7b68db31e65989 (patch) | |
tree | f2815a4697661469a5d4c2f9b3566967ebdfd869 /gnu | |
parent | 785e2f4cfd03c4154e390715dbd30fac1a5f178f (diff) |
use issetugid() instead of uid/gid comparisons; from drahn
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/ld/rtld/rtld.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c index f3a69a12b0e..054dd20eb86 100644 --- a/gnu/usr.bin/ld/rtld/rtld.c +++ b/gnu/usr.bin/ld/rtld/rtld.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld.c,v 1.22 2002/03/07 17:07:10 fgsch Exp $ */ +/* $OpenBSD: rtld.c,v 1.23 2002/06/03 09:28:07 deraadt Exp $ */ /* $NetBSD: rtld.c,v 1.43 1996/01/14 00:35:17 pk Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -147,8 +147,6 @@ char **environ; char *__progname = us; int errno; -static uid_t uid, euid; -static gid_t gid, egid; static int careful; static int anon_fd = -1; @@ -262,11 +260,8 @@ rtld(version, crtp, dp) /* Setup out (private) environ variable */ environ = crtp->crt_ep; - /* Get user and group identifiers */ - uid = getuid(); euid = geteuid(); - gid = getgid(); egid = getegid(); - - careful = (uid != euid) || (gid != egid); + if (issetugid()) + careful = 1; if (careful) { unsetenv("LD_LIBRARY_PATH"); |