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 <dlfcn.h> | 5 #include <dlfcn.h> |
6 #include <fcntl.h> | 6 #include <fcntl.h> |
7 #include <pthread.h> | 7 #include <pthread.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 // There need to be a corresponding call to PreinitializeSandboxFinish() | 456 // There need to be a corresponding call to PreinitializeSandboxFinish() |
457 // for each new process, this will be done in the Zygote child, once we know | 457 // for each new process, this will be done in the Zygote child, once we know |
458 // our process type. | 458 // our process type. |
459 linux_sandbox->PreinitializeSandboxBegin(); | 459 linux_sandbox->PreinitializeSandboxBegin(); |
460 | 460 |
461 sandbox::SetuidSandboxClient* setuid_sandbox = | 461 sandbox::SetuidSandboxClient* setuid_sandbox = |
462 linux_sandbox->setuid_sandbox_client(); | 462 linux_sandbox->setuid_sandbox_client(); |
463 | 463 |
464 if (forkdelegate != NULL) { | 464 if (forkdelegate != NULL) { |
465 VLOG(1) << "ZygoteMain: initializing fork delegate"; | 465 VLOG(1) << "ZygoteMain: initializing fork delegate"; |
466 forkdelegate->Init(setuid_sandbox->IsSuidSandboxChild(), | 466 forkdelegate->Init(Zygote::kBrowserDescriptor, |
467 Zygote::kBrowserDescriptor, | |
468 Zygote::kMagicSandboxIPCDescriptor); | 467 Zygote::kMagicSandboxIPCDescriptor); |
469 } else { | 468 } else { |
470 VLOG(1) << "ZygoteMain: fork delegate is NULL"; | 469 VLOG(1) << "ZygoteMain: fork delegate is NULL"; |
471 } | 470 } |
472 | 471 |
473 // Turn on the SELinux or SUID sandbox. | 472 // Turn on the SELinux or SUID sandbox. |
474 bool using_suid_sandbox = false; | 473 bool using_suid_sandbox = false; |
475 bool has_started_new_init = false; | 474 bool has_started_new_init = false; |
476 | 475 |
477 if (!EnterSandbox(setuid_sandbox, | 476 if (!EnterSandbox(setuid_sandbox, |
(...skipping 11 matching lines...) Expand all Loading... |
489 } | 488 } |
490 | 489 |
491 int sandbox_flags = linux_sandbox->GetStatus(); | 490 int sandbox_flags = linux_sandbox->GetStatus(); |
492 | 491 |
493 Zygote zygote(sandbox_flags, forkdelegate); | 492 Zygote zygote(sandbox_flags, forkdelegate); |
494 // This function call can return multiple times, once per fork(). | 493 // This function call can return multiple times, once per fork(). |
495 return zygote.ProcessRequests(); | 494 return zygote.ProcessRequests(); |
496 } | 495 } |
497 | 496 |
498 } // namespace content | 497 } // namespace content |
OLD | NEW |