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

Unified Diff: sandbox/mac/launchd_interception_server.cc

Issue 310833003: Make BootstrapSandboxPolicy a struct, containing the existing rule map and a new default rule. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const auto& Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/mac/bootstrap_sandbox_unittest.mm ('k') | sandbox/mac/policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/mac/launchd_interception_server.cc
diff --git a/sandbox/mac/launchd_interception_server.cc b/sandbox/mac/launchd_interception_server.cc
index 3cb1821b3951971d25b64d161ae3c03eceeef765..57264aa1e02b927fe6eef084552de4ae76e01365 100644
--- a/sandbox/mac/launchd_interception_server.cc
+++ b/sandbox/mac/launchd_interception_server.cc
@@ -191,10 +191,10 @@ void LaunchdInterceptionServer::HandleLookUp(mach_msg_header_t* request,
// Find the Rule for this service. If one is not found, use
// a safe default, POLICY_DENY_ERROR.
const BootstrapSandboxPolicy* policy = sandbox_->PolicyForProcess(sender_pid);
- const BootstrapSandboxPolicy::const_iterator it =
- policy->find(request_service_name);
- Rule rule(POLICY_DENY_ERROR);
- if (it != policy->end())
+ const BootstrapSandboxPolicy::NamedRules::const_iterator it =
+ policy->rules.find(request_service_name);
+ Rule rule(policy->default_rule);
+ if (it != policy->rules.end())
rule = it->second;
if (rule.result == POLICY_ALLOW) {
« no previous file with comments | « sandbox/mac/bootstrap_sandbox_unittest.mm ('k') | sandbox/mac/policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698