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

Unified Diff: chrome/common/chrome_content_client.cc

Issue 2357393003: Add check for file system access to the sandbox. (Closed)
Patch Set: Fix IsSandboxed() check when loading flash player. Created 4 years, 3 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/common/chrome_content_client.cc
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 75bd28d982d414eb9cedce97e57716b0248efff7..d13f2ede82618aa1fe64516224d7ee5196772d1d 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -52,6 +52,7 @@
#if defined(OS_LINUX)
#include <fcntl.h>
#include "chrome/common/component_flash_hint_file_linux.h"
+#include "sandbox/linux/services/credentials.h"
#endif // defined(OS_LINUX)
#if defined(OS_WIN)
@@ -299,13 +300,6 @@ void AddPepperFlashFromCommandLine(
}
#if defined(OS_LINUX)
-// This function tests if DIR_USER_DATA can be accessed, as a simple check to
-// see if the zygote has been sandboxed at this point.
-bool IsUserDataDirAvailable() {
- base::FilePath user_data_dir;
- return PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
-}
-
// This method is used on Linux only because of architectural differences in how
// it loads the component updated flash plugin, and not because the other
// platforms do not support component updated flash. On other platforms, the
@@ -493,7 +487,7 @@ void ChromeContentClient::AddPepperPlugins(
// is not always available. If it is not available, do not try and load any
// flash plugin. The flash player, if any, preloaded before the sandbox
// initialization will continue to be used.
- if (!IsUserDataDirAvailable()) {
+ if (!sandbox::Credentials::HasFileSystemAccess()) {
return;
}
#endif // defined(OS_LINUX)

Powered by Google App Engine
This is Rietveld 408576698