summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-20 16:51:01 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-20 16:51:01 +0000
commit1b6020c13edefec6850b9f58d856c5f95de7c1ea (patch)
treec40826d0556eabaa58a4e6df19fea6babd1d39f9
parent21a568e279210e6c521e178614dc30e6a1d19937 (diff)
downloadglibc-1b6020c13edefec6850b9f58d856c5f95de7c1ea.tar.gz
glibc-1b6020c13edefec6850b9f58d856c5f95de7c1ea.tar.xz
glibc-1b6020c13edefec6850b9f58d856c5f95de7c1ea.zip
Update.
	* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Initialize egid
	to 1.  This helps those installing ld.so SUID (nobody will be that
	stupid, I hope).  Don't define and use _dl_base_addr unless
	NEED_DL_BASE_ADDR is defined.
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/generic/dl-sysdep.c10
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4fb9da32ce..852a41584b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2001-01-20  Ulrich Drepper  <drepper@redhat.com>
 
+	* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Initialize egid
+	to 1.  This helps those installing ld.so SUID (nobody will be that
+	stupid, I hope).  Don't define and use _dl_base_addr unless
+	NEED_DL_BASE_ADDR is defined.
+
 	* io/ftw.c (ftw_dir): Add slash after directory name if there
 	wasn't any.  Reported by loris <loris@iol.it>.
 	* io/Makefile (tests): Add bug-ftw2.
diff --git a/sysdeps/generic/dl-sysdep.c b/sysdeps/generic/dl-sysdep.c
index 9807e6bc10..e6caf97240 100644
--- a/sysdeps/generic/dl-sysdep.c
+++ b/sysdeps/generic/dl-sysdep.c
@@ -51,7 +51,9 @@ extern void ENTRY_POINT (void);
 /* Protect SUID program against misuse of file descriptors.  */
 extern void __libc_check_standard_fds (void);
 
+#ifdef NEED_DL_BASE_ADDR
 ElfW(Addr) _dl_base_addr;
+#endif
 int __libc_enable_secure;
 int __libc_multiple_libcs = 0;	/* Defining this here avoids the inclusion
 				   of init-first.  */
@@ -87,8 +89,12 @@ _dl_sysdep_start (void **start_argptr,
   uid_t uid = 0;
   uid_t euid = 0;
   gid_t gid = 0;
+#ifdef HAVE_AUX_X
+  /* This adds a little bit of security.  If the kernel does not pass
+     any value up we default to the safe mode.  */
+  gid_t egid = 1;
+#else
   gid_t egid = 0;
-#ifndef HAVE_AUX_X
   unsigned int seen = 0;
 # define M(type) (1 << (type))
 #endif
@@ -114,9 +120,11 @@ _dl_sysdep_start (void **start_argptr,
       case AT_ENTRY:
 	user_entry = av->a_un.a_val;
 	break;
+#ifdef NEED_DL_BASE_ADDR
       case AT_BASE:
 	_dl_base_addr = av->a_un.a_val;
 	break;
+#endif
       case AT_UID:
 	uid = av->a_un.a_val;
 	break;