| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <unistd.h> | 6 #include <unistd.h> |
| 7 #include <sys/epoll.h> | 7 #include <sys/epoll.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
| 10 #include <sys/signal.h> | 10 #include <sys/signal.h> |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 mapping.push_back(std::make_pair( | 180 mapping.push_back(std::make_pair( |
| 181 static_cast<uint32_t>(kSandboxIPCChannel), 5)); | 181 static_cast<uint32_t>(kSandboxIPCChannel), 5)); |
| 182 | 182 |
| 183 child = fork(); | 183 child = fork(); |
| 184 | 184 |
| 185 if (!child) { | 185 if (!child) { |
| 186 close(3); // our socket from the browser is in fd 3 | 186 close(3); // our socket from the browser is in fd 3 |
| 187 Singleton<base::GlobalDescriptors>()->Reset(mapping); | 187 Singleton<base::GlobalDescriptors>()->Reset(mapping); |
| 188 CommandLine::Reset(); | 188 CommandLine::Reset(); |
| 189 CommandLine::Init(args); | 189 CommandLine::Init(args); |
| 190 CommandLine::SetProcTitle(); |
| 190 return true; | 191 return true; |
| 191 } | 192 } |
| 192 | 193 |
| 193 for (std::vector<int>::const_iterator | 194 for (std::vector<int>::const_iterator |
| 194 i = fds.begin(); i != fds.end(); ++i) | 195 i = fds.begin(); i != fds.end(); ++i) |
| 195 close(*i); | 196 close(*i); |
| 196 | 197 |
| 197 HANDLE_EINTR(write(fd, &child, sizeof(child))); | 198 HANDLE_EINTR(write(fd, &child, sizeof(child))); |
| 198 return false; | 199 return false; |
| 199 | 200 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 | 444 |
| 444 if (!MaybeEnterChroot()) { | 445 if (!MaybeEnterChroot()) { |
| 445 LOG(FATAL) << "Failed to enter sandbox. Fail safe abort. (errno: " | 446 LOG(FATAL) << "Failed to enter sandbox. Fail safe abort. (errno: " |
| 446 << errno << ")"; | 447 << errno << ")"; |
| 447 return false; | 448 return false; |
| 448 } | 449 } |
| 449 | 450 |
| 450 Zygote zygote; | 451 Zygote zygote; |
| 451 return zygote.ProcessRequests(); | 452 return zygote.ProcessRequests(); |
| 452 } | 453 } |
| OLD | NEW |