Date: Wed, 27 Apr 2011 00:59:22 +0300 From: George Liaskos <geo.liaskos@gmail.com> To: Rene Ladan <rene@freebsd.org> Cc: freebsd-chromium@freebsd.org Subject: Re: Chromium 11 patches Message-ID: <BANLkTik3rXta_n98BHjoQJ_YX-LGM9NFzw@mail.gmail.com> In-Reply-To: <4DB72016.2090806@freebsd.org> References: <BANLkTimgdyx_0=9r53bos2ncWS8t0DUDcA@mail.gmail.com> <BANLkTikwtGKWQt9oEjr3QiaVkMAMx1q9cw@mail.gmail.com> <4DB72016.2090806@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Tue, Apr 26, 2011 at 10:42 PM, Rene Ladan <rene@freebsd.org> wrote: > Op 26-04-2011 12:36, René Ladan schreef: >> 2011/4/26 George Liaskos <geo.liaskos@gmail.com>: >>> Hi list, >>> >>> I compiled Chromium 11 successfully with the patches available here, >>> ftp://cybertron.gr/pub/FreeBSD/Chromium/ >>> >> I'll merge them in the chruetertee repository if nobody else is faster. >> > Done (r157 of chromium-beta). Thanks again for the patches. > > René > -- > http://www.rene-ladan.nl:8080/ > > GPG fingerprint = ADBC ECCD EB5F A6B4 549F 600D 8C9E 647A E564 2BFC > (subkeys.pgp.net) There are some patches that we don't need: patch-base__logging.h patch-chrome__browser__process_singleton_linux.cc patch-content__browser_-renderer_host__render_sandbox_host_linux.cc [This is a dupe, missing an underscore between "browser" & "renderer"] Please, also merge the attached patches, i missed an include. Regards [-- Attachment #2 --] --- content/browser/zygote_host_linux.cc.orig 2011-04-16 11:01:10.000000000 +0300 +++ content/browser/zygote_host_linux.cc 2011-04-27 00:55:54.430982567 +0300 @@ -8,6 +8,9 @@ #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> +#if defined(OS_FREEBSD) +#include <sys/param.h> +#endif #include "base/command_line.h" #include "base/eintr_wrapper.h" @@ -61,8 +64,16 @@ } ZygoteHost::~ZygoteHost() { - if (init_) +#if defined(OS_FREEBSD) + Pickle pickle; +#endif + if (init_) { +#if defined(OS_FREEBSD) + pickle.WriteInt(kCmdEnd); + HANDLE_EINTR(write(control_fd_, pickle.data(), pickle.size())); +#endif close(control_fd_); + } } // static @@ -81,7 +92,11 @@ cmd_line.AppendSwitchASCII(switches::kProcessType, switches::kZygoteProcess); int fds[2]; +#if defined(OS_FREEBSD) && (__FreeBSD_version < 900030) + CHECK(socketpair(AF_UNIX, SOCK_DGRAM, 0, fds) == 0); +#else CHECK(socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) == 0); +#endif base::file_handle_mapping_vector fds_to_map; fds_to_map.push_back(std::make_pair(fds[1], 3)); @@ -149,6 +164,7 @@ // We need to look for it. // But first, wait for the zygote to tell us it's running. // The sending code is in chrome/browser/zygote_main_linux.cc. +#if defined(OS_LINUX) std::vector<int> fds_vec; const int kExpectedLength = sizeof(kZygoteMagic); char buf[kExpectedLength]; @@ -179,6 +195,7 @@ // Reap the sandbox. ProcessWatcher::EnsureProcessGetsReaped(process); } +#endif // defined(OS_LINUX) } else { // Not using the SUID sandbox. pid_ = process; @@ -245,9 +262,11 @@ if (pid <= 0) return base::kNullProcessHandle; } - + +#if defined(OS_LINUX) const int kRendererScore = 5; AdjustRendererOOMScore(pid, kRendererScore); +#endif return pid; } @@ -285,6 +304,7 @@ selinux_valid = true; } +#if defined(OS_LINUX) if (using_suid_sandbox_ && !selinux) { base::ProcessHandle sandbox_helper_process; std::vector<std::string> adj_oom_score_cmdline; @@ -302,6 +322,7 @@ if (!base::AdjustOOMScore(pid, score)) PLOG(ERROR) << "Failed to adjust OOM score of renderer with pid " << pid; } +#endif // defined(OS_LINUX) } void ZygoteHost::EnsureProcessTerminated(pid_t process) { [-- Attachment #3 --] --- content/browser/renderer_host/render_sandbox_host_linux.cc.orig 2011-04-16 11:01:10.000000000 +0300 +++ content/browser/renderer_host/render_sandbox_host_linux.cc 2011-04-27 00:17:53.236984447 +0300 @@ -13,6 +13,9 @@ #include <sys/socket.h> #include <sys/poll.h> #include <time.h> +#if defined(OS_FREEBSD) +#include <sys/param.h> +#endif #include <vector> @@ -665,7 +668,11 @@ // inherit some sockets. With PF_UNIX+SOCK_DGRAM, it can call sendmsg to send // a datagram to any (abstract) socket on the same system. With // SOCK_SEQPACKET, this is prevented. +#if defined(OS_FREEBSD) && (__FreeBSD_version < 900030) + CHECK(socketpair(AF_UNIX, SOCK_DGRAM, 0, fds) == 0); +#else CHECK(socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds) == 0); +#endif renderer_socket_ = fds[0]; const int browser_socket = fds[1];
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTik3rXta_n98BHjoQJ_YX-LGM9NFzw>
