aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-05-06 05:55:00 +0000
committerUlrich Drepper <drepper@redhat.com>2003-05-06 05:55:00 +0000
commit9946f75ad4b3183a09c3f3ff1c3554613fb4f485 (patch)
tree504a6ec55983ecdd7c5b77afbe9dd8ab511fa5d9
parente55674c65e88e6e15aa782a93cdabe20c4c8597b (diff)
downloadglibc-9946f75ad4b3183a09c3f3ff1c3554613fb4f485.zip
glibc-9946f75ad4b3183a09c3f3ff1c3554613fb4f485.tar.gz
glibc-9946f75ad4b3183a09c3f3ff1c3554613fb4f485.tar.bz2
Update.
2003-05-05 Ulrich Drepper <drepper@redhat.com> * sysdeps/generic/libc-start.c [!SHARED]: Call __libc_check_standard_fds after __libc_init_first.
-rw-r--r--ChangeLog5
-rw-r--r--linuxthreads/sysdeps/i386/tls.h6
-rw-r--r--sysdeps/generic/libc-start.c16
3 files changed, 17 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 1314811..db76996 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-05 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/generic/libc-start.c [!SHARED]: Call
+ __libc_check_standard_fds after __libc_init_first.
+
2003-05-05 Roland McGrath <roland@redhat.com>
* Makerules (common-before-compile): New variable.
diff --git a/linuxthreads/sysdeps/i386/tls.h b/linuxthreads/sysdeps/i386/tls.h
index 01965f7..456e8da 100644
--- a/linuxthreads/sysdeps/i386/tls.h
+++ b/linuxthreads/sysdeps/i386/tls.h
@@ -119,7 +119,7 @@ typedef struct
# include "useldt.h" /* For the structure. */
# define TLS_DO_MODIFY_LDT_KERNEL_CHECK(doit) \
(__builtin_expect (GL(dl_osversion) < 131939, 0) \
- ? "kernel too old for thread-local storage support" \
+ ? "kernel too old for thread-local storage support\n" \
: (doit))
# endif
@@ -142,7 +142,7 @@ TLS_DO_MODIFY_LDT_KERNEL_CHECK( \
"d" (sizeof (ldt_entry))); \
__builtin_expect (result, 0) == 0 \
? ({ asm ("movw %w0, %%gs" : : "q" ((nr) * 8 + 7)); NULL; }) \
- : "cannot set up LDT for thread-local storage"; \
+ : "cannot set up LDT for thread-local storage\n"; \
}))
# define TLS_DO_SET_THREAD_AREA(descr, secondcall) \
@@ -172,7 +172,7 @@ TLS_DO_MODIFY_LDT_KERNEL_CHECK( \
# ifdef __ASSUME_SET_THREAD_AREA_SYSCALL
# define TLS_SETUP_GS_SEGMENT(descr, secondcall) \
(TLS_DO_SET_THREAD_AREA (descr, secondcall) \
- ? "set_thread_area failed when setting up thread-local storage" : NULL)
+ ? "set_thread_area failed when setting up thread-local storage\n" : NULL)
# elif defined __NR_set_thread_area
# define TLS_SETUP_GS_SEGMENT(descr, secondcall) \
(TLS_DO_SET_THREAD_AREA (descr, secondcall) \
diff --git a/sysdeps/generic/libc-start.c b/sysdeps/generic/libc-start.c
index b98f0a2..04dae1d 100644
--- a/sysdeps/generic/libc-start.c
+++ b/sysdeps/generic/libc-start.c
@@ -141,13 +141,6 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
if (__pthread_initialize_minimal)
# endif
__pthread_initialize_minimal ();
-
- /* Some security at this point. Prevent starting a SUID binary where
- the standard file descriptors are not opened. We have to do this
- only for statically linked applications since otherwise the dynamic
- loader did the work already. */
- if (__builtin_expect (__libc_enable_secure, 0))
- __libc_check_standard_fds ();
#endif
/* Register the destructor of the dynamic linker if there is any. */
@@ -165,6 +158,15 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
if (fini)
__cxa_atexit ((void (*) (void *)) fini, NULL, NULL);
+#ifndef SHARED
+ /* Some security at this point. Prevent starting a SUID binary where
+ the standard file descriptors are not opened. We have to do this
+ only for statically linked applications since otherwise the dynamic
+ loader did the work already. */
+ if (__builtin_expect (__libc_enable_secure, 0))
+ __libc_check_standard_fds ();
+#endif
+
/* Call the initializer of the program, if any. */
#ifdef SHARED
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))