Skip to content

Commit

Permalink
Fix for not setting correct permissions for cache dir.
Browse files Browse the repository at this point in the history
In cases where a cache subdirectory is specified or when a user
defined cache directory base path is supplied, the existing code is passing a variable that contains the cache path before it is set. This CL fixes this issue.

(cherry picked from commit f60749b)

Bug: 1425903
Change-Id: I7cf6ed0aaa252e6d1310aba4fd0f8b5bf2671695
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4353312
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Abhijith Nair <abhijithnair@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1119552}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4355675
Reviewed-by: Krishna Govind <govind@chromium.org>
Owners-Override: Krishna Govind <govind@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/5665@{#6}
Cr-Branched-From: 8825f55-refs/heads/main@{#1119250}
  • Loading branch information
Abhijith Nair authored and Krishna Govind committed Mar 20, 2023
1 parent 78036d2 commit 720d60a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/android/java/src/org/chromium/base/PathUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private static String[] setPrivateDirectoryPathInternal() {
if (sCacheDirectoryBasePath != null || sCacheSubDirectory != null) {
cacheDir.mkdirs();
// Set to rwx--S--- as the Android cache dir has a distinct gid and is setgid.
chmod(paths[CACHE_DIRECTORY], 02700);
chmod(cacheDir.getPath(), 02700);
}
paths[CACHE_DIRECTORY] = cacheDir.getPath();
}
Expand Down

0 comments on commit 720d60a

Please sign in to comment.