Revert r180599 "[sanitizer] Clear LD_PRELOAD when forking an external symbolizer."

llvm-svn: 180602
This commit is contained in:
Sergey Matveev 2013-04-26 13:01:40 +00:00
parent 210257fb33
commit b2151b8200
3 changed files with 0 additions and 20 deletions

View File

@ -131,7 +131,6 @@ void DumpProcessMap();
bool FileExists(const char *filename); bool FileExists(const char *filename);
const char *GetEnv(const char *name); const char *GetEnv(const char *name);
bool SetEnv(const char *name, const char *value); bool SetEnv(const char *name, const char *value);
void UnsetEnv(const char *name);
const char *GetPwd(); const char *GetPwd();
u32 GetUid(); u32 GetUid();
void ReExec(); void ReExec();

View File

@ -278,20 +278,6 @@ bool SetEnv(const char *name, const char *value) {
} }
#endif #endif
void UnsetEnv(const char *name) {
uptr name_length = internal_strlen(name);
uptr last = 0;
while (environ[last]) last++;
for (uptr i = 0; environ[i]; i++)
if (internal_strlen(environ[i]) >= name_length + 1 &&
internal_strncmp(environ[i], name, name_length) == 0 &&
environ[i][name_length] == '=') {
last--;
environ[i] = environ[last];
environ[last] = 0;
}
}
#ifdef __GLIBC__ #ifdef __GLIBC__
extern "C" { extern "C" {

View File

@ -100,11 +100,6 @@ bool StartSymbolizerSubprocess(const char *path_to_symbolizer,
internal_close(infd[1]); internal_close(infd[1]);
for (int fd = getdtablesize(); fd > 2; fd--) for (int fd = getdtablesize(); fd > 2; fd--)
internal_close(fd); internal_close(fd);
// If the parent tool is used as a preloadable library, do not apply it to
// the symbolizer.
// FIXME: If LD_PRELOAD contains more than one object, we should keep those
// that have nothing to do with us.
UnsetEnv("LD_PRELOAD");
execl(path_to_symbolizer, path_to_symbolizer, (char*)0); execl(path_to_symbolizer, path_to_symbolizer, (char*)0);
internal__exit(1); internal__exit(1);
} }