diff options
author | Dimitry Ivanov <dimitry@google.com> | 2015-12-05 05:25:57 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-12-05 05:25:57 +0000 |
commit | e371ae68ac0d6d39cacf5edc893bda2f4a61e883 (patch) | |
tree | ed4a145da1fa0d684b7cc88d49ea8e094f3a5a1a /linker/linker.cpp | |
parent | 0d89913e74981cd51532e66a2e2f138392be4de1 (diff) | |
parent | 22840aab47763c88598b32d1edcac4d8b3ef21f0 (diff) |
Merge "Allow dlopening public libs using absolute path"
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r-- | linker/linker.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp index 706660085..82d0d9eb6 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -1582,9 +1582,6 @@ static int open_library(android_namespace_t* ns, } } - if (fd != -1 && !ns->is_accessible(*realpath)) { - fd = -1; - } return fd; } @@ -1701,6 +1698,13 @@ static bool load_library(android_namespace_t* ns, return false; } + if (!ns->is_accessible(realpath)) { + // do not load libraries if they are not accessible for the specified namespace. + DL_ERR("library \"%s\" is not accessible for the namespace \"%s\"", + name, ns->get_name()); + return false; + } + soinfo* si = soinfo_alloc(ns, realpath.c_str(), &file_stat, file_offset, rtld_flags); if (si == nullptr) { return false; |