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

Side by Side Diff: components/nacl/zygote/nacl_fork_delegate_linux.cc

Issue 335453009: Add SBX_CHROME_API_RQ to nacl_helper env whitelist (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // NACL_ENV_PASSTHROUGH="PATH,CWD" would pass both $PATH and $CWD to the child 50 // NACL_ENV_PASSTHROUGH="PATH,CWD" would pass both $PATH and $CWD to the child
51 // process. 51 // process.
52 const char kNaClEnvPassthrough[] = "NACL_ENV_PASSTHROUGH"; 52 const char kNaClEnvPassthrough[] = "NACL_ENV_PASSTHROUGH";
53 char kNaClEnvPassthroughDelimiter = ','; 53 char kNaClEnvPassthroughDelimiter = ',';
54 54
55 // The following environment variables are always passed through if they exist 55 // The following environment variables are always passed through if they exist
56 // in the parent process. 56 // in the parent process.
57 const char kNaClExeStderr[] = "NACL_EXE_STDERR"; 57 const char kNaClExeStderr[] = "NACL_EXE_STDERR";
58 const char kNaClExeStdout[] = "NACL_EXE_STDOUT"; 58 const char kNaClExeStdout[] = "NACL_EXE_STDOUT";
59 const char kNaClVerbosity[] = "NACLVERBOSITY"; 59 const char kNaClVerbosity[] = "NACLVERBOSITY";
60 const char kSbxChromeApiRq[] = "SBX_CHROME_API_RQ";
jln (very slow on Chromium) 2014/06/18 23:14:38 Could you include sandbox/linux/suid/sandbox.h ins
elijahtaylor1 2014/06/18 23:48:18 I did the first suggestion because the second seem
60 61
61 #if defined(ARCH_CPU_X86) 62 #if defined(ARCH_CPU_X86)
62 bool NonZeroSegmentBaseIsSlow() { 63 bool NonZeroSegmentBaseIsSlow() {
63 base::CPU cpuid; 64 base::CPU cpuid;
64 // Using a non-zero segment base is known to be very slow on Intel 65 // Using a non-zero segment base is known to be very slow on Intel
65 // Atom CPUs. See "Segmentation-based Memory Protection Mechanism 66 // Atom CPUs. See "Segmentation-based Memory Protection Mechanism
66 // on Intel Atom Microarchitecture: Coding Optimizations" (Leonardo 67 // on Intel Atom Microarchitecture: Coding Optimizations" (Leonardo
67 // Potenza, Intel). 68 // Potenza, Intel).
68 // 69 //
69 // The following list of CPU model numbers is taken from: 70 // The following list of CPU model numbers is taken from:
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(kSbxChromeApiRq);
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698