From db43526581c6d2cfdd0fedfd451e1a2e72b4b7a3 Mon Sep 17 00:00:00 2001 From: Dimitry Ivanov Date: Wed, 9 Dec 2015 19:36:47 +0000 Subject: [PATCH] Revert "Ensure that readlink has access to /proc/self/fd" This reverts commit 4e50d0247b9ace095e371865fad08b1a59672e3a. Bug: http://b/24912743 Change-Id: I5d32c670f0e16aec9c74add143158e919a301673 --- linker/linker.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/linker/linker.cpp b/linker/linker.cpp index 91f68494d..406cdee1a 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -364,13 +363,6 @@ static void parse_LD_PRELOAD(const char* path) { static bool realpath_fd(int fd, std::string* realpath) { std::vector buf(PATH_MAX), proc_self_fd(PATH_MAX); __libc_format_buffer(&proc_self_fd[0], proc_self_fd.size(), "/proc/self/fd/%d", fd); - // set DUMPABLE to 1 to access /proc/self/fd - int dumpable = prctl(PR_GET_DUMPABLE, 0, 0, 0, 0); - prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); - auto guard = make_scope_guard([&]() { - // restore dumpable - prctl(PR_SET_DUMPABLE, dumpable, 0, 0, 0); - }); if (readlink(&proc_self_fd[0], &buf[0], buf.size()) == -1) { PRINT("readlink('%s') failed: %s [fd=%d]", &proc_self_fd[0], strerror(errno), fd); return false;