From: Ulrich Drepper Date: Thu, 9 Jul 1998 14:05:24 +0000 (+0000) Subject: Remove LD* envvars if not used. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4023370b8aed9a3eb2746d9078575588b263f0d;p=thirdparty%2Fglibc.git Remove LD* envvars if not used. --- diff --git a/elf/rtld.c b/elf/rtld.c index e26e4574ad5..b5fc84286bc 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -26,6 +26,7 @@ #include "../stdio-common/_itoa.h" #include #include "dynamic-link.h" +#include /* System-specific function to do initial startup for the dynamic linker. @@ -154,6 +155,9 @@ dl_main (const ElfW(Phdr) *phdr, mode = getenv ("LD_TRACE_LOADED_OBJECTS") != NULL ? trace : normal; _dl_library_path = getenv ("LD_LIBRARY_PATH"); + if (__libc_enable_secure) + unsetenv ("LD_LIBRARY_PATH"); + /* LAZY is determined by the parameters --datadeps and --function-deps if we trace the binary. */ if (mode == trace) @@ -375,6 +379,9 @@ of this helper program; chances are you did not intend to run this program.\n", } if (list != NULL) list += strspn (list, " :"); + + if (__libc_enable_secure) + unsetenv ("LD_PRELOAD"); } /* Read the contents of the file. */ @@ -583,6 +590,10 @@ of this helper program; chances are you did not intend to run this program.\n", _exit (0); } +#ifdef EXTRA_UNSECURE_ENVVARS + EXTRA_UNSECURE_ENVVARS; +#endif + { /* Now we have all the objects loaded. Relocate them all except for the dynamic linker itself. We do this in reverse order so that copy