| 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 "components/nacl/zygote/nacl_fork_delegate_linux.h" | 5 #include "components/nacl/zygote/nacl_fork_delegate_linux.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <sys/resource.h> | 9 #include <sys/resource.h> |
| 10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 CommandLine cmd_line(CommandLine::NO_PROGRAM); | 160 CommandLine cmd_line(CommandLine::NO_PROGRAM); |
| 161 if (kUseNaClBootstrap) | 161 if (kUseNaClBootstrap) |
| 162 cmd_line.SetProgram(helper_bootstrap_exe); | 162 cmd_line.SetProgram(helper_bootstrap_exe); |
| 163 else | 163 else |
| 164 cmd_line.SetProgram(helper_exe); | 164 cmd_line.SetProgram(helper_exe); |
| 165 | 165 |
| 166 // Append any switches that need to be forwarded to the NaCl helper. | 166 // Append any switches that need to be forwarded to the NaCl helper. |
| 167 static const char* kForwardSwitches[] = { | 167 static const char* kForwardSwitches[] = { |
| 168 switches::kDisableSeccompFilterSandbox, | 168 switches::kDisableSeccompFilterSandbox, |
| 169 switches::kNoSandbox, | 169 switches::kNoSandbox, |
| 170 switches::kDisableNaClSfi, |
| 170 }; | 171 }; |
| 171 const CommandLine& current_cmd_line = *CommandLine::ForCurrentProcess(); | 172 const CommandLine& current_cmd_line = *CommandLine::ForCurrentProcess(); |
| 172 cmd_line.CopySwitchesFrom(current_cmd_line, kForwardSwitches, | 173 cmd_line.CopySwitchesFrom(current_cmd_line, kForwardSwitches, |
| 173 arraysize(kForwardSwitches)); | 174 arraysize(kForwardSwitches)); |
| 174 | 175 |
| 175 // The command line needs to be tightly controlled to use | 176 // The command line needs to be tightly controlled to use |
| 176 // |helper_bootstrap_exe|. So from now on, argv_to_launch should be | 177 // |helper_bootstrap_exe|. So from now on, argv_to_launch should be |
| 177 // modified directly. | 178 // modified directly. |
| 178 argv_to_launch = cmd_line.argv(); | 179 argv_to_launch = cmd_line.argv(); |
| 179 } | 180 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 int remote_exit_code; | 343 int remote_exit_code; |
| 343 if (!iter.ReadInt(&remote_exit_code)) { | 344 if (!iter.ReadInt(&remote_exit_code)) { |
| 344 LOG(ERROR) << "GetTerminationStatus: pickle failed"; | 345 LOG(ERROR) << "GetTerminationStatus: pickle failed"; |
| 345 return false; | 346 return false; |
| 346 } | 347 } |
| 347 | 348 |
| 348 *status = static_cast<base::TerminationStatus>(termination_status); | 349 *status = static_cast<base::TerminationStatus>(termination_status); |
| 349 *exit_code = remote_exit_code; | 350 *exit_code = remote_exit_code; |
| 350 return true; | 351 return true; |
| 351 } | 352 } |
| OLD | NEW |