From c801e76565467d2819ab0839804463f635d78b25 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 26 Jun 2003 19:54:29 +0000 Subject: 2003-06-26 Roland McGrath * elf/elf.h (AT_SECURE): New macro. * sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Grok it, set __libc_enable_secure. (_dl_show_auxv): Add AT_SECURE to name table. * elf/dl-support.c (_dl_aux_init): Grok AT_SECURE, set __libc_enable_secure and __libc_enable_secure_decided. * sysdeps/unix/sysv/linux/ldsodefs.h [__ASSUME_AT_SECURE] (HAVE_AUX_SECURE): Define it. * sysdeps/unix/sysv/linux/kernel-features.h [__LINUX_KERNEL_VERSION >= 132425] (__ASSUME_AT_SECURE): Define it. --- sysdeps/unix/sysv/linux/kernel-features.h | 6 ++++++ sysdeps/unix/sysv/linux/ldsodefs.h | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'sysdeps/unix') diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 408352590a..d26930bce6 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -321,3 +321,9 @@ #if __LINUX_KERNEL_VERSION >= 132426 # define __ASSUME_STATFS64 1 #endif + +/* Starting with at least 2.5.74 the kernel passes the setuid-like exec + flag unconditionally up to the child. */ +#if __LINUX_KERNEL_VERSION >= 132426 +# define __ASSUME_AT_SECURE 1 +#endif diff --git a/sysdeps/unix/sysv/linux/ldsodefs.h b/sysdeps/unix/sysv/linux/ldsodefs.h index a3c97c4731..c5fd854d70 100644 --- a/sysdeps/unix/sysv/linux/ldsodefs.h +++ b/sysdeps/unix/sysv/linux/ldsodefs.h @@ -1,5 +1,5 @@ /* Run-time dynamic linker data structures for loaded ELF shared objects. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -41,6 +41,12 @@ extern void _dl_non_dynamic_init (void) internal_function; # define HAVE_AUX_XID #endif +/* We can assume that the kernel always provides the AT_SECURE value + in the auxiliary vector from 2.5.74 or so on. */ +#if __ASSUME_AT_SECURE +# define HAVE_AUX_SECURE +#endif + /* Starting with one of the 2.4.0 pre-releases the Linux kernel passes up the page size information. */ #if __ASSUME_AT_PAGESIZE -- cgit v1.2.3