1 --- sysdeps/generic/unsecvars.h 2004-08-03 18:13:13 -0400
2 +++ sysdeps/generic/unsecvars.h 2004-08-03 18:11:41 -0400
4 with a '\0' explicitly. */
5 #define UNSECURE_ENVVARS \
8 + "LD_TRACE_PRELINKING\0" \
12 --- elf/rtld.c 2003-01-07 13:47:35 -0500
13 +++ elf/rtld.c 2004-08-03 22:15:51 -0400
14 @@ -1762,6 +1762,30 @@
16 = &"/var/tmp\0/var/profile"[INTUSE(__libc_enable_secure) ? 9 : 0];
18 + /* Extra security for SUID binaries. Remove all dangerous environment
20 + if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
22 + static const char unsecure_envvars[] =
23 +#ifdef EXTRA_UNSECURE_ENVVARS
24 + EXTRA_UNSECURE_ENVVARS
29 + nextp = unsecure_envvars;
33 + /* We could use rawmemchr but this need not be fast. */
34 + nextp = (char *) (strchr) (nextp, '\0') + 1;
36 + while (*nextp != '\0');
38 + if (__access ("/etc/suid-debug", F_OK) != 0)
39 + unsetenv ("MALLOC_CHECK_");
42 while ((envline = _dl_next_ld_env_entry (&runp)) != NULL)
45 @@ -1897,33 +1921,10 @@
46 /* The caller wants this information. */
49 - /* Extra security for SUID binaries. Remove all dangerous environment
51 - if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
53 - static const char unsecure_envvars[] =
54 -#ifdef EXTRA_UNSECURE_ENVVARS
55 - EXTRA_UNSECURE_ENVVARS
60 - nextp = unsecure_envvars;
64 - /* We could use rawmemchr but this need not be fast. */
65 - nextp = (char *) (strchr) (nextp, '\0') + 1;
67 - while (*nextp != '\0');
69 - if (__access ("/etc/suid-debug", F_OK) != 0)
70 - unsetenv ("MALLOC_CHECK_");
72 /* If we have to run the dynamic linker in debugging mode and the
73 LD_DEBUG_OUTPUT environment variable is given, we write the debug
74 messages to this file. */
75 - else if (any_debug && debug_output != NULL)
76 + if (any_debug && debug_output != NULL)
79 const int flags = O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW;