summaryrefslogtreecommitdiff
path: root/core/jni/fd_utils.cpp
diff options
context:
space:
mode:
authorChris Gross <chrisgross@google.com>2020-05-05 21:15:42 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-05-05 21:15:42 +0000
commit4ab8f542e9582417902aa42f208839df8f09485b (patch)
treeb9540a432614bad572be8b1683c12e09df3d4267 /core/jni/fd_utils.cpp
parentd14004d53b76e8f005d40c46128b598a34eaf118 (diff)
parent6abe4fb0a7a444b4867c2abf99d225da699522a0 (diff)
Merge "Allow bootjars in system_ext." am: 6abe4fb0a7
Change-Id: Id56f3b2ed464de43b9b029c16e5f874019b6a88c
Diffstat (limited to 'core/jni/fd_utils.cpp')
-rw-r--r--core/jni/fd_utils.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/core/jni/fd_utils.cpp b/core/jni/fd_utils.cpp
index ca4735ec665a..df3666ddfce2 100644
--- a/core/jni/fd_utils.cpp
+++ b/core/jni/fd_utils.cpp
@@ -81,11 +81,18 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const {
}
// Framework jars are allowed.
- static const char* kFrameworksPrefix = "/system/framework/";
+ static const char* kFrameworksPrefix[] = {
+ "/system/framework/",
+ "/system_ext/framework/",
+ };
+
static const char* kJarSuffix = ".jar";
- if (android::base::StartsWith(path, kFrameworksPrefix)
- && android::base::EndsWith(path, kJarSuffix)) {
- return true;
+
+ for (const auto& frameworks_prefix : kFrameworksPrefix) {
+ if (android::base::StartsWith(path, frameworks_prefix)
+ && android::base::EndsWith(path, kJarSuffix)) {
+ return true;
+ }
}
// Jars from the ART APEX are allowed.