Add NOEXEC support for AIX 5.3 which supports LDR_PRELOAD and

LDR_PRELOAD64.  The 64-bit version is not currently supported.
Remove zero_env() prototype as it no longer exists.
This commit is contained in:
Todd C. Miller
2007-01-31 15:00:48 +00:00
parent 9d6695ed43
commit bf500a00d6

12
env.c
View File

@@ -96,7 +96,6 @@ struct environment {
* Prototypes * Prototypes
*/ */
char **rebuild_env __P((char **, int, int)); char **rebuild_env __P((char **, int, int));
char **zero_env __P((char **));
static void insert_env __P((char *, struct environment *, int)); static void insert_env __P((char *, struct environment *, int));
static char *format_env __P((char *, ...)); static char *format_env __P((char *, ...));
@@ -118,8 +117,9 @@ static const char *initial_badenv_table[] = {
"SHLIB_PATH", "SHLIB_PATH",
#endif /* __hpux */ #endif /* __hpux */
#ifdef _AIX #ifdef _AIX
"LDR_*",
"LIBPATH", "LIBPATH",
#endif /* _AIX */ #endif
#ifdef __APPLE__ #ifdef __APPLE__
"DYLD_*", "DYLD_*",
#endif #endif
@@ -483,9 +483,13 @@ rebuild_env(envp, sudo_mode, noexec)
insert_env(format_env("_RLD_LIST", def_noexec_file, ":DEFAULT", VNULL), insert_env(format_env("_RLD_LIST", def_noexec_file, ":DEFAULT", VNULL),
&env, 1); &env, 1);
# else # else
# ifdef _AIX
insert_env(format_env("LDR_PRELOAD", def_noexec_file, VNULL), &env, 1);
# else
insert_env(format_env("LD_PRELOAD", def_noexec_file, VNULL), &env, 1); insert_env(format_env("LD_PRELOAD", def_noexec_file, VNULL), &env, 1);
# endif # endif /* _AIX */
#endif # endif /* __osf__ || __sgi */
#endif /* __darwin__ || __APPLE__ */
} }
/* Set PS1 if SUDO_PS1 is set. */ /* Set PS1 if SUDO_PS1 is set. */