- use issetugid()

- be paranoid about honoring LD_LIBMAP_DISABLE.

Suggested by:	 rwatson
This commit is contained in:
Matthew N. Dodd 2003-05-31 15:24:29 +00:00
parent 341b3de62b
commit c930fec7a2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115448

View File

@ -262,13 +262,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
argv0 = argv[0] != NULL ? argv[0] : "(null)";
environ = env;
trust = geteuid() == getuid() && getegid() == getgid();
libmap_disable = getenv("LD_LIBMAP_DISABLE") != NULL;
trust = !issetugid();
ld_bind_now = getenv("LD_BIND_NOW");
if (trust) {
ld_debug = getenv("LD_DEBUG");
libmap_disable = getenv("LD_LIBMAP_DISABLE") != NULL;
ld_library_path = getenv("LD_LIBRARY_PATH");
ld_preload = getenv("LD_PRELOAD");
}