]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove LD* envvars if not used.
authorUlrich Drepper <drepper@redhat.com>
Thu, 9 Jul 1998 14:05:24 +0000 (14:05 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 9 Jul 1998 14:05:24 +0000 (14:05 +0000)
elf/rtld.c

index e26e4574ad59ddb6665b35905c66f2bcee37c1bd..b5fc84286bcac9b9349f4a9b00f0ef57caa60384 100644 (file)
@@ -26,6 +26,7 @@
 #include "../stdio-common/_itoa.h"
 #include <assert.h>
 #include "dynamic-link.h"
+#include <dl-envvars.h>
 
 
 /* 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