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

Side by Side Diff: content/browser/sandbox_parameters_mac.mm

Issue 2973453002: Fix sandbox profile for MacOS 10.9 Mavericks. (Closed)
Patch Set: Cleanup per review Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « content/browser/OWNERS ('k') | content/common/sandbox_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/sandbox_parameters_mac.h" 5 #include "content/browser/sandbox_parameters_mac.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 17 matching lines...) Expand all
28 28
29 CHECK(client->SetBooleanParameter(Sandbox::kSandboxEnableLogging, 29 CHECK(client->SetBooleanParameter(Sandbox::kSandboxEnableLogging,
30 enable_logging)); 30 enable_logging));
31 CHECK(client->SetBooleanParameter(Sandbox::kSandboxDisableDenialLogging, 31 CHECK(client->SetBooleanParameter(Sandbox::kSandboxDisableDenialLogging,
32 !enable_logging)); 32 !enable_logging));
33 33
34 std::string homedir = 34 std::string homedir =
35 Sandbox::GetCanonicalSandboxPath(base::GetHomeDir()).value(); 35 Sandbox::GetCanonicalSandboxPath(base::GetHomeDir()).value();
36 CHECK(client->SetParameter(Sandbox::kSandboxHomedirAsLiteral, homedir)); 36 CHECK(client->SetParameter(Sandbox::kSandboxHomedirAsLiteral, homedir));
37 37
38 CHECK(client->SetBooleanParameter(Sandbox::kSandboxMavericks,
39 base::mac::IsOS10_9()));
40
38 bool elcap_or_later = base::mac::IsAtLeastOS10_11(); 41 bool elcap_or_later = base::mac::IsAtLeastOS10_11();
39 CHECK(client->SetBooleanParameter(Sandbox::kSandboxElCapOrLater, 42 CHECK(client->SetBooleanParameter(Sandbox::kSandboxElCapOrLater,
40 elcap_or_later)); 43 elcap_or_later));
41 44
42 std::string bundle_path = 45 std::string bundle_path =
43 Sandbox::GetCanonicalSandboxPath(base::mac::MainBundlePath()).value(); 46 Sandbox::GetCanonicalSandboxPath(base::mac::MainBundlePath()).value();
44 CHECK(client->SetParameter(Sandbox::kSandboxBundlePath, bundle_path)); 47 CHECK(client->SetParameter(Sandbox::kSandboxBundlePath, bundle_path));
45 48
46 NSBundle* bundle = base::mac::OuterBundle(); 49 NSBundle* bundle = base::mac::OuterBundle();
47 std::string bundle_id = base::SysNSStringToUTF8([bundle bundleIdentifier]); 50 std::string bundle_id = base::SysNSStringToUTF8([bundle bundleIdentifier]);
(...skipping 12 matching lines...) Expand all
60 // the dylibs live. 63 // the dylibs live.
61 base::FilePath component_path = base::mac::MainBundlePath().Append(".."); 64 base::FilePath component_path = base::mac::MainBundlePath().Append("..");
62 std::string component_path_canonical = 65 std::string component_path_canonical =
63 Sandbox::GetCanonicalSandboxPath(component_path).value(); 66 Sandbox::GetCanonicalSandboxPath(component_path).value();
64 CHECK(client->SetParameter(Sandbox::kSandboxComponentPath, 67 CHECK(client->SetParameter(Sandbox::kSandboxComponentPath,
65 component_path_canonical)); 68 component_path_canonical));
66 #endif 69 #endif
67 } 70 }
68 71
69 } // namespace content 72 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/OWNERS ('k') | content/common/sandbox_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698