diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-11 11:19:32 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-11 11:19:32 +0000 |
commit | 64fb9acba969a51fc806df5ae8e3e60e05994b78 (patch) | |
tree | f237cdd9716b147bab976a4dcfc26afada4ca712 /chrome/common | |
parent | 8e20ea65bca98e1f3b0b46a5b69f7726e7959f1c (diff) | |
download | chromium_src-64fb9acba969a51fc806df5ae8e3e60e05994b78.zip chromium_src-64fb9acba969a51fc806df5ae8e3e60e05994b78.tar.gz chromium_src-64fb9acba969a51fc806df5ae8e3e60e05994b78.tar.bz2 |
Mac: Fail early on Sandbox errors
We know that on certain machines the Seatbelt library is borked and even a simple test program that initializes the sandbox fails.
There is already a CHECK() in chrome_dll_main() that fires if the Sandbox didn't initialize correctly. This CL changes all sandbox failures to LOG(FATAL)s so we get different stack signatures when we crash.
BUG=44761
TEST=Browser & Unit tests should continue to function correctly.
Review URL: http://codereview.chromium.org/2861046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52058 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/sandbox_mac.mm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/chrome/common/sandbox_mac.mm b/chrome/common/sandbox_mac.mm index 80e01f3..bc0929e 100644 --- a/chrome/common/sandbox_mac.mm +++ b/chrome/common/sandbox_mac.mm @@ -301,8 +301,8 @@ bool EnableSandbox(SandboxProcessType sandbox_type, error:NULL]; if (!common_sandbox_prefix_data) { - LOG(ERROR) << "Failed to find the sandbox profile on disk " - << [common_sandbox_prefix_path fileSystemRepresentation]; + LOG(FATAL) << "Failed to find the sandbox profile on disk " + << [common_sandbox_prefix_path fileSystemRepresentation]; return false; } @@ -315,8 +315,8 @@ bool EnableSandbox(SandboxProcessType sandbox_type, error:NULL]; if (!sandbox_data) { - LOG(ERROR) << "Failed to find the sandbox profile on disk " - << [sandbox_profile_path fileSystemRepresentation]; + LOG(FATAL) << "Failed to find the sandbox profile on disk " + << [sandbox_profile_path fileSystemRepresentation]; return false; } @@ -347,14 +347,14 @@ bool EnableSandbox(SandboxProcessType sandbox_type, // returns). FilePath allowed_dir_absolute(allowed_dir); if (!file_util::AbsolutePath(&allowed_dir_absolute)) { - PLOG(ERROR) << "Failed to resolve absolute path"; + PLOG(FATAL) << "Failed to resolve absolute path"; return false; } std::string allowed_dir_escaped; if (!QuoteStringForRegex(allowed_dir_absolute.value(), &allowed_dir_escaped)) { - LOG(ERROR) << "Regex string quoting failed " << allowed_dir.value(); + LOG(FATAL) << "Regex string quoting failed " << allowed_dir.value(); return false; } NSString* allowed_dir_escaped_ns = base::SysUTF8ToNSString( @@ -386,7 +386,7 @@ bool EnableSandbox(SandboxProcessType sandbox_type, std::string home_dir = base::SysNSStringToUTF8(NSHomeDirectory()); std::string home_dir_escaped; if (!QuotePlainString(home_dir, &home_dir_escaped)) { - LOG(ERROR) << "Sandbox string quoting failed"; + LOG(FATAL) << "Sandbox string quoting failed"; return false; } NSString* home_dir_escaped_ns = base::SysUTF8ToNSString(home_dir_escaped); @@ -403,7 +403,7 @@ bool EnableSandbox(SandboxProcessType sandbox_type, char* error_buff = NULL; int error = sandbox_init([sandbox_data UTF8String], 0, &error_buff); bool success = (error == 0 && error_buff == NULL); - LOG_IF(ERROR, !success) << "Failed to initialize sandbox: " + LOG_IF(FATAL, !success) << "Failed to initialize sandbox: " << error << " " << error_buff; |