Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3677)

Unified Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 2786583002: chromeos: Check both original and absolute paths for file: scheme (Closed)
Patch Set: remove dcheck Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index 6686bd3c3e723911f6ac8e4c750e6e113efdb62e..b11644ada43c790b34cb4af8c7a96256a6d5a193 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -447,8 +447,10 @@ bool ChromeNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
return allow;
}
-bool ChromeNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
- const base::FilePath& path) const {
+bool ChromeNetworkDelegate::OnCanAccessFile(
+ const net::URLRequest& request,
+ const base::FilePath& original_path,
+ const base::FilePath& absolute_path) const {
#if defined(OS_CHROMEOS)
// browser_tests and interactive_ui_tests rely on the ability to open any
// files via file: scheme.
@@ -456,7 +458,14 @@ bool ChromeNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
return true;
#endif
- return IsAccessAllowed(path, profile_path_);
+#if defined(OS_ANDROID)
+ // Android's whitelist relies on symbolic links (ex. /sdcard is whitelisted
+ // and commonly a symbolic link), thus do not check absolute paths.
+ return IsAccessAllowed(original_path, profile_path_);
+#else
+ return (IsAccessAllowed(original_path, profile_path_) &&
+ IsAccessAllowed(absolute_path, profile_path_));
+#endif
}
// static
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.h ('k') | chrome/browser/net/chrome_network_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698