Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe5bf7a7 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Fix mount path prefix checking." into klp-dev

parents 95867a65 5786a278
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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 + "/";