Make checking the linux installed headers optional (instead of systematic).
1 2001-01-08 Ulrich Drepper <drepper@redhat.com>
3 * elf/rtld.c (process_envvars): Place output files for profiling
4 in SUID binaries in /var/profile.
6 * elf/dl-load.c (_dl_map_object): Don't look in cache for
7 preloading in SUID binaries.
9 * elf/dl-profile.c (_dl_start_profile): Open the output file with
10 O_NOFOLLOW if possible.
12 * sysdeps/generic/segfault.c (install_handler): Check output file
15 --- libc/elf/rtld.c 2000/03/15 05:42:01 1.148.2.7
16 +++ libc/elf/rtld.c 2001/01/10 07:45:19
18 char *debug_output = NULL;
20 /* This is the default place for profiling data file. */
21 - _dl_profile_output = "/var/tmp";
22 + _dl_profile_output = __libc_enable_secure ? "/var/profile" : "/var/tmp";
24 while ((envline = _dl_next_ld_env_entry (&runp)) != NULL)
26 --- libc/elf/dl-load.c 1999/11/20 02:26:38 1.103.2.5
27 +++ libc/elf/dl-load.c 2001/01/10 07:45:20
29 if (fd == -1 && env_path_list != NULL)
30 fd = open_path (name, namelen, preloaded, env_path_list, &realname);
33 + if (fd == -1 && (! preloaded || ! __libc_enable_secure))
35 /* Check the list of libraries in the file /etc/ld.so.cache,
36 for compatibility with Linux's ldconfig program. */
37 --- libc/elf/dl-profile.c 1998/06/07 13:35:48 1.14
38 +++ libc/elf/dl-profile.c 2001/01/10 07:45:21
41 __stpcpy (__stpcpy (cp, _dl_profile), ".profile");
43 - fd = __open (filename, O_RDWR | O_CREAT, 0666);
45 +# define EXTRA_FLAGS | O_NOFOLLOW
49 + fd = __open (filename, O_RDWR | O_CREAT EXTRA_FLAGS, 0666);
52 /* We cannot write the profiling data so don't do anything. */
53 --- libc/sysdeps/generic/segfault.c 2000/03/21 04:53:40 1.10.2.2
54 +++ libc/sysdeps/generic/segfault.c 2001/01/10 07:45:22
57 /* Preserve the output file name if there is any given. */
58 name = getenv ("SEGFAULT_OUTPUT_NAME");
59 - if (name != NULL && name[0] != '\0')
60 + if (name != NULL && name[0] != '\0'
61 + && (!__libc_enable_secure || access (name, R_OK | W_OK) == 0))
62 fname = __strdup (name);
65 --- libc/sysdeps/unix/sysv/linux/i386/dl-librecon.h.jj Wed Feb 24 23:01:58 1999
66 +++ libc/sysdeps/unix/sysv/linux/i386/dl-librecon.h Mon Jan 15 04:30:57 2001
68 /* Recognizing extra environment variables. */
69 #define EXTRA_LD_ENVVARS \
71 - if (memcmp (&envline[3], "LIBRARY_VERSION", 15) == 0) \
72 + if (!__libc_enable_secure \
73 + && memcmp (&envline[3], "LIBRARY_VERSION", 15) == 0) \
75 _dl_correct_cache_id = envline[19] == '5' ? 2 : 3; \
79 /* Extra unsecure variables. */
80 -#define EXTRA_UNSECURE_ENVVARS "LD_AOUT_LIBRARY_PATH", "LD_AOUT_PRELOAD"
81 +#define EXTRA_UNSECURE_ENVVARS \
82 + "LD_AOUT_LIBRARY_PATH", \
83 + "LD_AOUT_PRELOAD", \
84 + "LD_LIBRARY_VERSION"
86 #endif /* dl-librecon.h */