summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-10-03 17:18:38 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-03 17:18:38 +0000
commitfe5bf7a7c7dcf3353c345d18471b90426d9404a3 (patch)
tree67a2e78988c43a170182614dca66bceeeebe0d71 /services
parent95867a652410b5f0193cf301f5737381bcbd3a88 (diff)
parent5786a278a5ccc183a8d64933ff49f67a57c1ee2b (diff)
downloadframeworks_base-fe5bf7a7c7dcf3353c345d18471b90426d9404a3.zip
frameworks_base-fe5bf7a7c7dcf3353c345d18471b90426d9404a3.tar.gz
frameworks_base-fe5bf7a7c7dcf3353c345d18471b90426d9404a3.tar.bz2
Merge "Fix mount path prefix checking." into klp-dev
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/MountService.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java
index 6ab86f5..59ec777 100644
--- a/services/java/com/android/server/MountService.java
+++ b/services/java/com/android/server/MountService.java
@@ -2145,6 +2145,10 @@ class MountService extends IMountService.Stub
return -1;
}
+ if (!appPath.endsWith("/")) {
+ appPath = appPath + "/";
+ }
+
// Try translating the app path into a vold path, but require that it
// belong to the calling package.
String voldPath = maybeTranslatePathForVold(appPath,
@@ -2194,9 +2198,9 @@ class MountService extends IMountService.Stub
}
for (int i = 0; i < appPaths.length; i++) {
- final String appPath = appPaths[i].getAbsolutePath();
+ final String appPath = appPaths[i].getAbsolutePath() + "/";
if (path.startsWith(appPath)) {
- path = new File(voldPaths[i], path.substring(appPath.length() + 1))
+ path = new File(voldPaths[i], path.substring(appPath.length()))
.getAbsolutePath();
if (!path.endsWith("/")) {
path = path + "/";