OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/sandbox_mac.h" | 5 #include "content/common/sandbox_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 extern "C" { | 9 extern "C" { |
10 #include <sandbox.h> | 10 #include <sandbox.h> |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 if (lion_or_later) { | 539 if (lion_or_later) { |
540 // >=10.7 Sandbox rules. | 540 // >=10.7 Sandbox rules. |
541 [tokens_to_remove addObject:@";10.7_OR_ABOVE"]; | 541 [tokens_to_remove addObject:@";10.7_OR_ABOVE"]; |
542 } | 542 } |
543 | 543 |
544 substitutions["COMPONENT_BUILD_WORKAROUND"] = SandboxSubstring(""); | 544 substitutions["COMPONENT_BUILD_WORKAROUND"] = SandboxSubstring(""); |
545 #if defined(COMPONENT_BUILD) | 545 #if defined(COMPONENT_BUILD) |
546 // dlopen() fails without file-read-metadata access if the executable image | 546 // dlopen() fails without file-read-metadata access if the executable image |
547 // contains LC_RPATH load commands. The components build uses those. | 547 // contains LC_RPATH load commands. The components build uses those. |
548 // See http://crbug.com/127465 | 548 // See http://crbug.com/127465 |
549 if (base::mac::IsOSSnowLeopardOrEarlier()) { | 549 if (base::mac::IsOSSnowLeopard()) { |
550 FilePath bundle_executable = base::mac::NSStringToFilePath( | 550 FilePath bundle_executable = base::mac::NSStringToFilePath( |
551 [base::mac::MainBundle() executablePath]); | 551 [base::mac::MainBundle() executablePath]); |
552 NSString* sandbox_command = AllowMetadataForPath( | 552 NSString* sandbox_command = AllowMetadataForPath( |
553 GetCanonicalSandboxPath(bundle_executable)); | 553 GetCanonicalSandboxPath(bundle_executable)); |
554 substitutions["COMPONENT_BUILD_WORKAROUND"] = | 554 substitutions["COMPONENT_BUILD_WORKAROUND"] = |
555 SandboxSubstring(base::SysNSStringToUTF8(sandbox_command)); | 555 SandboxSubstring(base::SysNSStringToUTF8(sandbox_command)); |
556 } | 556 } |
557 #endif | 557 #endif |
558 | 558 |
559 // All information needed to assemble the final profile has been collected. | 559 // All information needed to assemble the final profile has been collected. |
(...skipping 30 matching lines...) Expand all Loading... |
590 if (HANDLE_EINTR(fcntl(fd, F_GETPATH, canonical_path)) != 0) { | 590 if (HANDLE_EINTR(fcntl(fd, F_GETPATH, canonical_path)) != 0) { |
591 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " | 591 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
592 << path.value(); | 592 << path.value(); |
593 return path; | 593 return path; |
594 } | 594 } |
595 | 595 |
596 return FilePath(canonical_path); | 596 return FilePath(canonical_path); |
597 } | 597 } |
598 | 598 |
599 } // namespace sandbox | 599 } // namespace sandbox |
OLD | NEW |