|
@@ -43,7 +43,7 @@
|
|
|
|
|
|
* with setuid stuff? If we are dynamically linked, then we
|
|
|
* already have _dl_secure, otherwise we need to re-examine
|
|
|
- * auxvt[] below.
|
|
|
+ * _dl_auxvt[] below.
|
|
|
*/
|
|
|
int _pe_secure = 0;
|
|
|
libc_hidden_data_def(_pe_secure)
|
|
@@ -373,7 +373,6 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,
|
|
|
{
|
|
|
#ifndef SHARED
|
|
|
unsigned long *aux_dat;
|
|
|
- ElfW(auxv_t) auxvt[AT_EGID + 1];
|
|
|
#endif
|
|
|
|
|
|
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
|
|
@@ -399,23 +398,14 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,
|
|
|
|
|
|
#ifndef SHARED
|
|
|
|
|
|
- memset(auxvt, 0x00, sizeof(auxvt));
|
|
|
aux_dat = (unsigned long*)__environ;
|
|
|
while (*aux_dat) {
|
|
|
aux_dat++;
|
|
|
}
|
|
|
aux_dat++;
|
|
|
- while (*aux_dat) {
|
|
|
- ElfW(auxv_t) *auxv_entry = (ElfW(auxv_t) *) aux_dat;
|
|
|
- if (auxv_entry->a_type <= AT_EGID) {
|
|
|
- memcpy(&(auxvt[auxv_entry->a_type]), auxv_entry, sizeof(ElfW(auxv_t)));
|
|
|
- }
|
|
|
- aux_dat += 2;
|
|
|
- }
|
|
|
|
|
|
It will be used into __libc_setup_tls. */
|
|
|
-
|
|
|
- _dl_aux_init (auxvt);
|
|
|
+ _dl_aux_init ((ElfW(auxv_t) *)aux_dat);
|
|
|
#endif
|
|
|
|
|
|
|
|
@@ -431,10 +421,10 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,
|
|
|
#ifndef SHARED
|
|
|
|
|
|
* stderr file descriptors are not already opened. */
|
|
|
- if ((auxvt[AT_UID].a_un.a_val == (size_t)-1 && __check_suid()) ||
|
|
|
- (auxvt[AT_UID].a_un.a_val != (size_t)-1 &&
|
|
|
- (auxvt[AT_UID].a_un.a_val != auxvt[AT_EUID].a_un.a_val ||
|
|
|
- auxvt[AT_GID].a_un.a_val != auxvt[AT_EGID].a_un.a_val)))
|
|
|
+ if ((_dl_auxvt[AT_UID].a_un.a_val == (size_t)-1 && __check_suid()) ||
|
|
|
+ (_dl_auxvt[AT_UID].a_un.a_val != (size_t)-1 &&
|
|
|
+ (_dl_auxvt[AT_UID].a_un.a_val != _dl_auxvt[AT_EUID].a_un.a_val ||
|
|
|
+ _dl_auxvt[AT_GID].a_un.a_val != _dl_auxvt[AT_EGID].a_un.a_val)))
|
|
|
#else
|
|
|
if (_dl_secure)
|
|
|
#endif
|