diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 19:44:43 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 19:44:43 +0000 |
commit | 9154c36eb5f87dc90ece4b4c8492a7d15b6e5469 (patch) | |
tree | 36c0a0273d298f7f309c6cbfba6b1270fa60de0f | |
parent | 342688ed5c5e4ee1fb79de98fe1c481047583233 (diff) | |
download | chromium_src-9154c36eb5f87dc90ece4b4c8492a7d15b6e5469.zip chromium_src-9154c36eb5f87dc90ece4b4c8492a7d15b6e5469.tar.gz chromium_src-9154c36eb5f87dc90ece4b4c8492a7d15b6e5469.tar.bz2 |
Fix crash-on-launch on Snow Leopard
The signal-self syntax needed to fix bug 20370 doesn't work on Leopard and
causes the Sandbox to barf so renderers don't star tup.
We introduce a ;10.5_ONLY keyword to the sandbox that is substituted at runtime (the line with the rule is effectively uncommented). This allows us to use leopard or snow-leapard-only sandbox syntax
BUG=20516
TEST=Chrome should no longer crash on launch under SL.
Review URL: http://codereview.chromium.org/183003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24777 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/renderer.sb | 3 | ||||
-rw-r--r-- | chrome/renderer/renderer_main_platform_delegate_mac.mm | 14 |
2 files changed, 16 insertions, 1 deletions
diff --git a/chrome/renderer/renderer.sb b/chrome/renderer/renderer.sb index f5a00f6..c43a8ed 100644 --- a/chrome/renderer/renderer.sb +++ b/chrome/renderer/renderer.sb @@ -7,7 +7,8 @@ (deny default) ; Allow sending signals to self - http://crbug.com/20370 -(allow %signal-self) +; ;10.5_ONLY is substitued for a blank string at runtime as needed. +;10.5_ONLY (allow %signal-self) ; Needed for full-page-zoomed controls - http://crbug.com/11325 (allow sysctl-read) diff --git a/chrome/renderer/renderer_main_platform_delegate_mac.mm b/chrome/renderer/renderer_main_platform_delegate_mac.mm index a165909..0b657c3 100644 --- a/chrome/renderer/renderer_main_platform_delegate_mac.mm +++ b/chrome/renderer/renderer_main_platform_delegate_mac.mm @@ -131,6 +131,20 @@ bool RendererMainPlatformDelegate::EnableSandbox() { stringByReplacingOccurrencesOfString:@"USER_HOMEDIR" withString:NSHomeDirectory()]; + // Enable 10.5 only sandbox syntax. + int32 major_version = 0; + int32 minor_version = 0; + int32 bugfix_version = 0; + base::SysInfo::OperatingSystemVersionNumbers(&major_version, + &minor_version, + &bugfix_version); + + if (major_version == 10 && minor_version == 5) { + sandbox_data = [sandbox_data + stringByReplacingOccurrencesOfString:@";10.5_ONLY" + withString:@""]; + } + char* error_buff = NULL; int error = sandbox_init([sandbox_data UTF8String], 0, &error_buff); bool success = (error == 0 && error_buff == NULL); |