diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-01-20 16:51:01 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-01-20 16:51:01 +0000 |
commit | 1b6020c13edefec6850b9f58d856c5f95de7c1ea (patch) | |
tree | c40826d0556eabaa58a4e6df19fea6babd1d39f9 /sysdeps/generic/dl-sysdep.c | |
parent | 21a568e279210e6c521e178614dc30e6a1d19937 (diff) | |
download | glibc-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.
Diffstat (limited to 'sysdeps/generic/dl-sysdep.c')
-rw-r--r-- | sysdeps/generic/dl-sysdep.c | 10 |
1 files changed, 9 insertions, 1 deletions
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; |