Module Name: src Committed By: christos Date: Wed Dec 2 15:50:13 UTC 2009
Modified Files: src/libexec/ld.elf_so: rtld.c Log Message: If the environment is corrupt, die. From FreeBSD. To generate a diff of this commit: cvs rdiff -u -r1.126 -r1.127 src/libexec/ld.elf_so/rtld.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/libexec/ld.elf_so/rtld.c diff -u src/libexec/ld.elf_so/rtld.c:1.126 src/libexec/ld.elf_so/rtld.c:1.127 --- src/libexec/ld.elf_so/rtld.c:1.126 Tue Nov 17 13:44:33 2009 +++ src/libexec/ld.elf_so/rtld.c Wed Dec 2 10:50:13 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rtld.c,v 1.126 2009/11/17 18:44:33 skrll Exp $ */ +/* $NetBSD: rtld.c,v 1.127 2009/12/02 15:50:13 christos Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -40,7 +40,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: rtld.c,v 1.126 2009/11/17 18:44:33 skrll Exp $"); +__RCSID("$NetBSD: rtld.c,v 1.127 2009/12/02 15:50:13 christos Exp $"); #endif /* not lint */ #include <err.h> @@ -439,8 +439,8 @@ getenv("LD_LIBRARY_PATH")); } else { execname = NULL; - unsetenv("LD_DEBUG"); - unsetenv("LD_LIBRARY_PATH"); + if (unsetenv("LD_DEBUG") || unsetenv("LD_LIBRARY_PATH")) + _rtld_die(); } _rtld_process_hints(execname, &_rtld_paths, &_rtld_xforms, _PATH_LD_HINTS); @@ -514,7 +514,8 @@ if (_rtld_preload(getenv("LD_PRELOAD")) == -1) _rtld_die(); } else - unsetenv("LD_PRELOAD"); + if (unsetenv("LD_PRELOAD")) + _rtld_die(); dbg(("loading needed objects")); if (_rtld_load_needed_objects(_rtld_objmain, RTLD_MAIN) == -1)