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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 return true; | 440 return true; |
441 } | 441 } |
442 | 442 |
443 // static | 443 // static |
444 void NaClForkDelegate::AddPassthroughEnvToOptions( | 444 void NaClForkDelegate::AddPassthroughEnvToOptions( |
445 base::LaunchOptions* options) { | 445 base::LaunchOptions* options) { |
446 scoped_ptr<base::Environment> env(base::Environment::Create()); | 446 scoped_ptr<base::Environment> env(base::Environment::Create()); |
447 std::string pass_through_string; | 447 std::string pass_through_string; |
448 std::vector<std::string> pass_through_vars; | 448 std::vector<std::string> pass_through_vars; |
449 if (env->GetVar(kNaClEnvPassthrough, &pass_through_string)) { | 449 if (env->GetVar(kNaClEnvPassthrough, &pass_through_string)) { |
450 base::SplitString( | 450 pass_through_vars = base::SplitString( |
451 pass_through_string, kNaClEnvPassthroughDelimiter, &pass_through_vars); | 451 pass_through_string, std::string(1, kNaClEnvPassthroughDelimiter), |
| 452 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
452 } | 453 } |
453 pass_through_vars.push_back(kNaClExeStderr); | 454 pass_through_vars.push_back(kNaClExeStderr); |
454 pass_through_vars.push_back(kNaClExeStdout); | 455 pass_through_vars.push_back(kNaClExeStdout); |
455 pass_through_vars.push_back(kNaClVerbosity); | 456 pass_through_vars.push_back(kNaClVerbosity); |
456 pass_through_vars.push_back(sandbox::kSandboxEnvironmentApiRequest); | 457 pass_through_vars.push_back(sandbox::kSandboxEnvironmentApiRequest); |
457 for (size_t i = 0; i < pass_through_vars.size(); ++i) { | 458 for (size_t i = 0; i < pass_through_vars.size(); ++i) { |
458 std::string temp; | 459 std::string temp; |
459 if (env->GetVar(pass_through_vars[i].c_str(), &temp)) | 460 if (env->GetVar(pass_through_vars[i].c_str(), &temp)) |
460 options->environ[pass_through_vars[i]] = temp; | 461 options->environ[pass_through_vars[i]] = temp; |
461 } | 462 } |
462 } | 463 } |
463 | 464 |
464 } // namespace nacl | 465 } // namespace nacl |
OLD | NEW |