| 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 "content/browser/zygote_host_impl_linux.h" | 5 #include "content/browser/zygote_host_impl_linux.h" |
| 6 | 6 |
| 7 #include <sys/socket.h> | 7 #include <sys/socket.h> |
| 8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "base/time.h" | 26 #include "base/time.h" |
| 27 #include "base/utf_string_conversions.h" | 27 #include "base/utf_string_conversions.h" |
| 28 #include "content/browser/renderer_host/render_sandbox_host_linux.h" | 28 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
| 29 #include "content/common/unix_domain_socket_posix.h" | 29 #include "content/common/unix_domain_socket_posix.h" |
| 30 #include "content/public/browser/content_browser_client.h" | 30 #include "content/public/browser/content_browser_client.h" |
| 31 #include "content/public/common/content_switches.h" | 31 #include "content/public/common/content_switches.h" |
| 32 #include "content/public/common/result_codes.h" | 32 #include "content/public/common/result_codes.h" |
| 33 #include "sandbox/linux/suid/suid_unsafe_environment_variables.h" | 33 #include "sandbox/linux/suid/suid_unsafe_environment_variables.h" |
| 34 | 34 |
| 35 #if defined(USE_TCMALLOC) | 35 #if defined(USE_TCMALLOC) |
| 36 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" | 36 #include "third_party/tcmalloc/chromium/src/google/heap-profiler.h" |
| 37 #endif | 37 #endif |
| 38 | 38 |
| 39 static void SaveSUIDUnsafeEnvironmentVariables() { | 39 static void SaveSUIDUnsafeEnvironmentVariables() { |
| 40 // The ELF loader will clear many environment variables so we save them to | 40 // The ELF loader will clear many environment variables so we save them to |
| 41 // different names here so that the SUID sandbox can resolve them for the | 41 // different names here so that the SUID sandbox can resolve them for the |
| 42 // renderer. | 42 // renderer. |
| 43 | 43 |
| 44 for (unsigned i = 0; kSUIDUnsafeEnvironmentVariables[i]; ++i) { | 44 for (unsigned i = 0; kSUIDUnsafeEnvironmentVariables[i]; ++i) { |
| 45 const char* const envvar = kSUIDUnsafeEnvironmentVariables[i]; | 45 const char* const envvar = kSUIDUnsafeEnvironmentVariables[i]; |
| 46 char* const saved_envvar = SandboxSavedEnvironmentVariable(envvar); | 46 char* const saved_envvar = SandboxSavedEnvironmentVariable(envvar); |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 456 |
| 457 pid_t ZygoteHostImpl::GetSandboxHelperPid() const { | 457 pid_t ZygoteHostImpl::GetSandboxHelperPid() const { |
| 458 return RenderSandboxHostLinux::GetInstance()->pid(); | 458 return RenderSandboxHostLinux::GetInstance()->pid(); |
| 459 } | 459 } |
| 460 | 460 |
| 461 int ZygoteHostImpl::GetSandboxStatus() const { | 461 int ZygoteHostImpl::GetSandboxStatus() const { |
| 462 if (have_read_sandbox_status_word_) | 462 if (have_read_sandbox_status_word_) |
| 463 return sandbox_status_; | 463 return sandbox_status_; |
| 464 return 0; | 464 return 0; |
| 465 } | 465 } |
| OLD | NEW |