OSDN Git Service

fd_utils: fix DEBUG mode booting issue
authorMauro Rossi <issor.oruam@gmail.com>
Mon, 11 Sep 2017 22:17:10 +0000 (00:17 +0200)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sun, 10 Dec 2017 15:43:50 +0000 (23:43 +0800)
Porting to oreo-x86 codebase of nougat-x86 commit
bca7b1f81f "fd_utils: fix DEBUG mode booting issue"

Original commit message:

Remove the "/android/" prefix before the white list checking.

Suggested by Chris Vandomelen <chris@sightworks.com>.

core/jni/fd_utils.cpp

index 956b724..5bddda7 100644 (file)
@@ -165,6 +165,8 @@ FileDescriptorInfo* FileDescriptorInfo::CreateFromFd(int fd) {
   const std::string fd_path = android::base::StringPrintf("/proc/self/fd/%d", fd);
   if (!android::base::Readlink(fd_path, &file_path)) {
     return NULL;
+  } else if (!strncmp(file_path.c_str(), "/android/", 9)) {
+    file_path = file_path.substr(8);
   }
 
   if (!whitelist->IsAllowed(file_path)) {