Commit 9e733282 authored by grunell@chromium.org's avatar grunell@chromium.org

Proper multi profile file access check for WebRTC logs on ChromeOS.

BUG=376691

Review URL: https://codereview.chromium.org/340053002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278104 0039d316-1c4b-4281-b951-d872f2087c98
parent d78999e9
......@@ -796,15 +796,20 @@ bool ChromeNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
"/var/log",
};
// The actual location of "/home/chronos/user/Downloads" is the Downloads
// directory under the profile path ("/home/chronos/user' is a hard link to
// current primary logged in profile.) For the support of multi-profile
// sessions, we are switching to use explicit "$PROFILE_PATH/Downloads" path
// and here whitelist such access.
// The actual location of "/home/chronos/user/Xyz" is the Xyz directory under
// the profile path ("/home/chronos/user' is a hard link to current primary
// logged in profile.) For the support of multi-profile sessions, we are
// switching to use explicit "$PROFILE_PATH/Xyz" path and here whitelist such
// access.
if (!profile_path_.empty()) {
const base::FilePath downloads = profile_path_.AppendASCII("Downloads");
if (downloads == path.StripTrailingSeparators() || downloads.IsParent(path))
return true;
const base::FilePath webrtc_logs = profile_path_.AppendASCII("WebRTC Logs");
if (webrtc_logs == path.StripTrailingSeparators() ||
webrtc_logs.IsParent(path)) {
return true;
}
}
#elif defined(OS_ANDROID)
// Access to files in external storage is allowed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment