| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <dlfcn.h> | 5 #include <dlfcn.h> |
| 6 #include <fcntl.h> | 6 #include <fcntl.h> |
| 7 #include <pthread.h> | 7 #include <pthread.h> |
| 8 #include <sys/epoll.h> | 8 #include <sys/epoll.h> |
| 9 #include <sys/prctl.h> | 9 #include <sys/prctl.h> |
| 10 #include <sys/signal.h> | 10 #include <sys/signal.h> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "content/browser/zygote_host_linux.h" | 22 #include "content/browser/zygote_host_linux.h" |
| 23 | 23 |
| 24 #include "base/basictypes.h" | 24 #include "base/basictypes.h" |
| 25 #include "base/command_line.h" | 25 #include "base/command_line.h" |
| 26 #include "base/eintr_wrapper.h" | 26 #include "base/eintr_wrapper.h" |
| 27 #include "base/file_path.h" | 27 #include "base/file_path.h" |
| 28 #include "base/global_descriptors_posix.h" | 28 #include "base/global_descriptors_posix.h" |
| 29 #include "base/hash_tables.h" | 29 #include "base/hash_tables.h" |
| 30 #include "base/linux_util.h" | 30 #include "base/linux_util.h" |
| 31 #include "base/memory/scoped_ptr.h" | 31 #include "base/memory/scoped_ptr.h" |
| 32 #include "base/nss_util.h" | |
| 33 #include "base/path_service.h" | 32 #include "base/path_service.h" |
| 34 #include "base/pickle.h" | 33 #include "base/pickle.h" |
| 35 #include "base/process_util.h" | 34 #include "base/process_util.h" |
| 36 #include "base/rand_util.h" | 35 #include "base/rand_util.h" |
| 37 #include "base/sys_info.h" | 36 #include "base/sys_info.h" |
| 38 #include "build/build_config.h" | 37 #include "build/build_config.h" |
| 38 #include "crypto/nss_util.h" |
| 39 #include "chrome/common/chrome_paths.h" | 39 #include "chrome/common/chrome_paths.h" |
| 40 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
| 41 #include "chrome/common/pepper_plugin_registry.h" | 41 #include "chrome/common/pepper_plugin_registry.h" |
| 42 #include "content/common/chrome_descriptors.h" | 42 #include "content/common/chrome_descriptors.h" |
| 43 #include "content/common/font_config_ipc_linux.h" | 43 #include "content/common/font_config_ipc_linux.h" |
| 44 #include "content/common/main_function_params.h" | 44 #include "content/common/main_function_params.h" |
| 45 #include "content/common/process_watcher.h" | 45 #include "content/common/process_watcher.h" |
| 46 #include "content/common/result_codes.h" | 46 #include "content/common/result_codes.h" |
| 47 #include "content/common/sandbox_methods_linux.h" | 47 #include "content/common/sandbox_methods_linux.h" |
| 48 #include "content/common/set_process_title.h" | 48 #include "content/common/set_process_title.h" |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 // Each Renderer we spawn will re-attempt initialization of the media | 601 // Each Renderer we spawn will re-attempt initialization of the media |
| 602 // libraries, at which point failure will be detected and handled, so | 602 // libraries, at which point failure will be detected and handled, so |
| 603 // we do not need to cope with initialization failures here. | 603 // we do not need to cope with initialization failures here. |
| 604 FilePath media_path; | 604 FilePath media_path; |
| 605 if (PathService::Get(chrome::DIR_MEDIA_LIBS, &media_path)) | 605 if (PathService::Get(chrome::DIR_MEDIA_LIBS, &media_path)) |
| 606 media::InitializeMediaLibrary(media_path); | 606 media::InitializeMediaLibrary(media_path); |
| 607 #if defined(USE_NSS) | 607 #if defined(USE_NSS) |
| 608 // NSS libraries are loaded before sandbox is activated. This is to allow | 608 // NSS libraries are loaded before sandbox is activated. This is to allow |
| 609 // successful initialization of NSS which tries to load extra library files. | 609 // successful initialization of NSS which tries to load extra library files. |
| 610 // Doing so will allow NSS to be used within sandbox for chromoting. | 610 // Doing so will allow NSS to be used within sandbox for chromoting. |
| 611 base::LoadNSSLibraries(); | 611 crypto::LoadNSSLibraries(); |
| 612 #else | 612 #else |
| 613 // TODO(bulach): implement openssl support. | 613 // TODO(bulach): implement openssl support. |
| 614 NOTREACHED() << "Remoting is not supported for openssl"; | 614 NOTREACHED() << "Remoting is not supported for openssl"; |
| 615 #endif | 615 #endif |
| 616 | 616 |
| 617 // Ensure access to the Pepper plugins before the sandbox is turned on. | 617 // Ensure access to the Pepper plugins before the sandbox is turned on. |
| 618 PepperPluginRegistry::PreloadModules(); | 618 PepperPluginRegistry::PreloadModules(); |
| 619 } | 619 } |
| 620 | 620 |
| 621 #if !defined(CHROMIUM_SELINUX) | 621 #if !defined(CHROMIUM_SELINUX) |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 VLOG(1) << "Enabling experimental Seccomp sandbox."; | 761 VLOG(1) << "Enabling experimental Seccomp sandbox."; |
| 762 sandbox_flags |= ZygoteHost::kSandboxSeccomp; | 762 sandbox_flags |= ZygoteHost::kSandboxSeccomp; |
| 763 } | 763 } |
| 764 } | 764 } |
| 765 #endif // SECCOMP_SANDBOX | 765 #endif // SECCOMP_SANDBOX |
| 766 | 766 |
| 767 Zygote zygote(sandbox_flags); | 767 Zygote zygote(sandbox_flags); |
| 768 // This function call can return multiple times, once per fork(). | 768 // This function call can return multiple times, once per fork(). |
| 769 return zygote.ProcessRequests(); | 769 return zygote.ProcessRequests(); |
| 770 } | 770 } |
| OLD | NEW |