| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/zygote_host_linux.h" | 5 #include "chrome/browser/zygote_host_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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 for (unsigned i = 0; kSUIDUnsafeEnvironmentVariables[i]; ++i) { | 38 for (unsigned i = 0; kSUIDUnsafeEnvironmentVariables[i]; ++i) { |
| 39 const char* const envvar = kSUIDUnsafeEnvironmentVariables[i]; | 39 const char* const envvar = kSUIDUnsafeEnvironmentVariables[i]; |
| 40 char* const saved_envvar = SandboxSavedEnvironmentVariable(envvar); | 40 char* const saved_envvar = SandboxSavedEnvironmentVariable(envvar); |
| 41 if (!saved_envvar) | 41 if (!saved_envvar) |
| 42 continue; | 42 continue; |
| 43 | 43 |
| 44 scoped_ptr<base::Environment> env(base::Environment::Create()); | 44 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 45 std::string value; | 45 std::string value; |
| 46 if (env->GetEnv(envvar, &value)) | 46 if (env->GetEnv(envvar, &value)) |
| 47 env->SetEnv(saved_envvar, value); | 47 env->SetVar(saved_envvar, value); |
| 48 else | 48 else |
| 49 env->UnSetVar(saved_envvar); | 49 env->UnSetVar(saved_envvar); |
| 50 | 50 |
| 51 free(saved_envvar); | 51 free(saved_envvar); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 ZygoteHost::ZygoteHost() | 55 ZygoteHost::ZygoteHost() |
| 56 : pid_(-1), | 56 : pid_(-1), |
| 57 init_(false), | 57 init_(false), |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 !read_pickle.ReadBool(&iter, &tmp_child_exited)) { | 335 !read_pickle.ReadBool(&iter, &tmp_child_exited)) { |
| 336 LOG(WARNING) << "Error parsing DidProcessCrash response from zygote."; | 336 LOG(WARNING) << "Error parsing DidProcessCrash response from zygote."; |
| 337 return false; | 337 return false; |
| 338 } | 338 } |
| 339 | 339 |
| 340 if (child_exited) | 340 if (child_exited) |
| 341 *child_exited = tmp_child_exited; | 341 *child_exited = tmp_child_exited; |
| 342 | 342 |
| 343 return did_crash; | 343 return did_crash; |
| 344 } | 344 } |
| OLD | NEW |