OSDN Git Service

Ensure that readlink has access to /proc/self/fd
authorDmitriy Ivanov <dimitry@google.com>
Wed, 14 Oct 2015 18:15:45 +0000 (11:15 -0700)
committerDmitriy Ivanov <dimitry@google.com>
Thu, 15 Oct 2015 01:24:54 +0000 (18:24 -0700)
commit4e50d0247b9ace095e371865fad08b1a59672e3a
treed74a75b036e8a17fdfbcd94edf05041f24ed9d9b
parent198d13e8c25e69f7dbda3f5e1a3258b13fe8db5d
Ensure that readlink has access to /proc/self/fd

/proc/self/fd is not available when PR_DUMPABLE is set to 0
which is default for the user builds. It leads to permission
denials on readlink.

This change fixes the problem by setting PR_DUMPABLE flag to 1
for readlink and restoring it's previous value after the call.

Bug: http://b/24912743
Change-Id: I3fd179c5c6b56af96d6a15ee597024ccb15e1a13
(cherry picked from commit cf92738fa5dee24050028a1235f815f2a0fd33b5)
linker/linker.cpp