diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 04:22:47 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 04:22:47 +0000 |
commit | 83a0cbe4af4408d7708bf54750aff66da80f3130 (patch) | |
tree | c75050f0d74936645b8b87f5e9aab9ded61e5bbc /chrome/app | |
parent | da11a4be3902edcdfb5c2f29925e068ebce36a67 (diff) | |
download | chromium_src-83a0cbe4af4408d7708bf54750aff66da80f3130.zip chromium_src-83a0cbe4af4408d7708bf54750aff66da80f3130.tar.gz chromium_src-83a0cbe4af4408d7708bf54750aff66da80f3130.tar.bz2 |
Revert 30938 - Add support for getting the real process id from within the suid sandbox. The browser processes gets the real process ids, so they look correct in the task manager. When it asks the zygote to reap a process, we use the process ids internal to the sandbox.
While we are at it, reap the sandbox process after it clones the zygote and figure out zygote's actual process id. Save the actual process id rather than that of the sandbox.
BUG=20012,20714,23072
TEST=Process IDs for renderers should be correct in the task manager and you should be able to use the end process button to kill them.
Review URL: http://codereview.chromium.org/262020
Review URL: http://codereview.chromium.org/359001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30939 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 22e95d2..f46ec70 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -18,8 +18,8 @@ #elif defined(OS_POSIX) #include <locale.h> #include <signal.h> -#include <sys/stat.h> #include <sys/types.h> +#include <sys/stat.h> #include <unistd.h> #endif @@ -27,7 +27,6 @@ #include <gdk/gdk.h> #include <glib.h> #include <gtk/gtk.h> -#include <stdlib.h> #include <string.h> #endif @@ -59,7 +58,6 @@ #if defined(OS_LINUX) #include "base/nss_init.h" #include "chrome/browser/renderer_host/render_sandbox_host_linux.h" -#include "chrome/browser/zygote_host_linux.h" #endif #if defined(OS_MACOSX) @@ -387,7 +385,7 @@ int ChromeMain(int argc, char** argv) { browser_pid = static_cast<base::ProcessId>(StringToInt(WideToASCII(channel_name))); - DCHECK_NE(browser_pid, 0); + DCHECK(browser_pid != 0); #else browser_pid = base::GetCurrentProcId(); #endif @@ -581,29 +579,8 @@ int ChromeMain(int argc, char** argv) { #endif } else if (process_type.empty()) { #if defined(OS_LINUX) - const char* sandbox_binary = NULL; - struct stat st; - - // In Chromium branded builds, developers can set an environment variable to - // use the development sandbox. See - // http://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment - if (stat("/proc/self/exe", &st) == 0 && st.st_uid == getuid()) - sandbox_binary = getenv("CHROME_DEVEL_SANDBOX"); - -#if defined(LINUX_SANDBOX_PATH) - if (!sandbox_binary) - sandbox_binary = LINUX_SANDBOX_PATH; -#endif - - std::string sandbox_cmd; - if (sandbox_binary) - sandbox_cmd = sandbox_binary; - - // Tickle the sandbox host and zygote host so they fork now. - RenderSandboxHostLinux* shost = Singleton<RenderSandboxHostLinux>().get(); - shost->Init(sandbox_cmd); - ZygoteHost* zhost = Singleton<ZygoteHost>().get(); - zhost->Init(sandbox_cmd); + // Tickle the sandbox host so it forks now. + Singleton<RenderSandboxHostLinux>().get(); // We want to be sure to init NSPR on the main thread. base::EnsureNSPRInit(); @@ -618,7 +595,7 @@ int ChromeMain(int argc, char** argv) { // gtk_init() can change |argc| and |argv|. gtk_init(&argc, &argv); SetUpGLibLogHandler(); -#endif // defined(OS_LINUX) +#endif ScopedOleInitializer ole_initializer; rv = BrowserMain(main_params); |