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 18 matching lines...) Expand all Loading... |
29 #include "base/strings/string_split.h" | 29 #include "base/strings/string_split.h" |
30 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 30 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
31 #include "build/build_config.h" | 31 #include "build/build_config.h" |
32 #include "components/nacl/common/nacl_nonsfi_util.h" | 32 #include "components/nacl/common/nacl_nonsfi_util.h" |
33 #include "components/nacl/common/nacl_paths.h" | 33 #include "components/nacl/common/nacl_paths.h" |
34 #include "components/nacl/common/nacl_switches.h" | 34 #include "components/nacl/common/nacl_switches.h" |
35 #include "components/nacl/loader/nacl_helper_linux.h" | 35 #include "components/nacl/loader/nacl_helper_linux.h" |
36 #include "content/public/common/content_descriptors.h" | 36 #include "content/public/common/content_descriptors.h" |
37 #include "content/public/common/content_switches.h" | 37 #include "content/public/common/content_switches.h" |
38 #include "sandbox/linux/suid/client/setuid_sandbox_client.h" | 38 #include "sandbox/linux/suid/client/setuid_sandbox_client.h" |
| 39 #include "sandbox/linux/suid/common/sandbox.h" |
39 | 40 |
40 namespace { | 41 namespace { |
41 | 42 |
42 // Note these need to match up with their counterparts in nacl_helper_linux.c | 43 // Note these need to match up with their counterparts in nacl_helper_linux.c |
43 // and nacl_helper_bootstrap_linux.c. | 44 // and nacl_helper_bootstrap_linux.c. |
44 const char kNaClHelperReservedAtZero[] = | 45 const char kNaClHelperReservedAtZero[] = |
45 "--reserved_at_zero=0xXXXXXXXXXXXXXXXX"; | 46 "--reserved_at_zero=0xXXXXXXXXXXXXXXXX"; |
46 const char kNaClHelperRDebug[] = "--r_debug=0xXXXXXXXXXXXXXXXX"; | 47 const char kNaClHelperRDebug[] = "--r_debug=0xXXXXXXXXXXXXXXXX"; |
47 | 48 |
48 // This is an environment variable which controls which (if any) other | 49 // This is an environment variable which controls which (if any) other |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 scoped_ptr<base::Environment> env(base::Environment::Create()); | 424 scoped_ptr<base::Environment> env(base::Environment::Create()); |
424 std::string pass_through_string; | 425 std::string pass_through_string; |
425 std::vector<std::string> pass_through_vars; | 426 std::vector<std::string> pass_through_vars; |
426 if (env->GetVar(kNaClEnvPassthrough, &pass_through_string)) { | 427 if (env->GetVar(kNaClEnvPassthrough, &pass_through_string)) { |
427 base::SplitString( | 428 base::SplitString( |
428 pass_through_string, kNaClEnvPassthroughDelimiter, &pass_through_vars); | 429 pass_through_string, kNaClEnvPassthroughDelimiter, &pass_through_vars); |
429 } | 430 } |
430 pass_through_vars.push_back(kNaClExeStderr); | 431 pass_through_vars.push_back(kNaClExeStderr); |
431 pass_through_vars.push_back(kNaClExeStdout); | 432 pass_through_vars.push_back(kNaClExeStdout); |
432 pass_through_vars.push_back(kNaClVerbosity); | 433 pass_through_vars.push_back(kNaClVerbosity); |
| 434 pass_through_vars.push_back(sandbox::kSandboxEnvironmentApiRequest); |
433 for (size_t i = 0; i < pass_through_vars.size(); ++i) { | 435 for (size_t i = 0; i < pass_through_vars.size(); ++i) { |
434 std::string temp; | 436 std::string temp; |
435 if (env->GetVar(pass_through_vars[i].c_str(), &temp)) | 437 if (env->GetVar(pass_through_vars[i].c_str(), &temp)) |
436 options->environ[pass_through_vars[i]] = temp; | 438 options->environ[pass_through_vars[i]] = temp; |
437 } | 439 } |
438 } | 440 } |
439 | 441 |
440 } // namespace nacl | 442 } // namespace nacl |
OLD | NEW |