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

Unified Diff: sandbox/mac/launchd_interception_server.cc

Issue 347783002: Alter the design of the bootstrap sandbox to only take over the bootstrap port of children when nec… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 6 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/launchd_interception_server.h ('k') | sandbox/mac/mach_message_server.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 70fd33ea720a584b47c576efc5676ccfc56fbbcb..c3d6eaac57928ff5c53ea44cde2a139b5e08c444 100644
--- a/sandbox/mac/launchd_interception_server.cc
+++ b/sandbox/mac/launchd_interception_server.cc
@@ -27,7 +27,7 @@ LaunchdInterceptionServer::LaunchdInterceptionServer(
LaunchdInterceptionServer::~LaunchdInterceptionServer() {
}
-bool LaunchdInterceptionServer::Initialize() {
+bool LaunchdInterceptionServer::Initialize(mach_port_t server_receive_right) {
mach_port_t task = mach_task_self();
kern_return_t kr;
@@ -46,7 +46,8 @@ bool LaunchdInterceptionServer::Initialize() {
}
sandbox_send_port_.reset(sandbox_port_);
- message_server_.reset(new MachMessageServer(this, kBufferSize));
+ message_server_.reset(
+ new MachMessageServer(this, server_receive_right, kBufferSize));
return message_server_->Initialize();
}
@@ -59,9 +60,9 @@ void LaunchdInterceptionServer::DemuxMessage(mach_msg_header_t* request,
sandbox_->PolicyForProcess(sender_pid);
if (policy == NULL) {
// No sandbox policy is in place for the sender of this message, which
- // means it is from the sandbox host process or an unsandboxed child.
- VLOG(3) << "Message from pid " << sender_pid << " forwarded to launchd";
- ForwardMessage(request);
+ // means it came from the unknown. Reject it.
+ VLOG(3) << "Message from unknown pid " << sender_pid << " rejected.";
+ message_server_->RejectMessage(request, MIG_REMOTE_ERROR);
return;
}
« no previous file with comments | « sandbox/mac/launchd_interception_server.h ('k') | sandbox/mac/mach_message_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698