diff options
Diffstat (limited to 'chrome/common/sandbox_mac.mm')
-rw-r--r-- | chrome/common/sandbox_mac.mm | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/chrome/common/sandbox_mac.mm b/chrome/common/sandbox_mac.mm index 6ede3bf..42cec0c 100644 --- a/chrome/common/sandbox_mac.mm +++ b/chrome/common/sandbox_mac.mm @@ -485,23 +485,20 @@ bool Sandbox::EnableSandbox(SandboxProcessType sandbox_type, substitutions["DISABLE_SANDBOX_DENIAL_LOGGING"] = SandboxSubstring(""); } + // Splice the path of the user's home directory into the sandbox profile + // (see renderer.sb for details). + std::string home_dir = base::SysNSStringToUTF8(NSHomeDirectory()); + + FilePath home_dir_canonical(home_dir); + GetCanonicalSandboxPath(&home_dir_canonical); + + substitutions["USER_HOMEDIR_AS_LITERAL"] = + SandboxSubstring(home_dir_canonical.value(), + SandboxSubstring::LITERAL); + if (snow_leopard_or_higher) { // 10.6-only Sandbox rules. [tokens_to_remove addObject:@";10.6_ONLY"]; - // Splice the path of the user's home directory into the sandbox profile - // (see renderer.sb for details). - // This code is in the 10.6-only block because the sandbox syntax we use - // for this "subdir" is only supported on 10.6. - // If we ever need this on pre-10.6 OSs then we'll have to rethink the - // surrounding sandbox syntax. - std::string home_dir = base::SysNSStringToUTF8(NSHomeDirectory()); - - FilePath home_dir_canonical(home_dir); - GetCanonicalSandboxPath(&home_dir_canonical); - - substitutions["USER_HOMEDIR_AS_LITERAL"] = - SandboxSubstring(home_dir_canonical.value(), - SandboxSubstring::LITERAL); } else { // Sandbox rules only for versions before 10.6. [tokens_to_remove addObject:@";BEFORE_10.6"]; |