chromium: add ability to control which sandbox is used
First step towards addressing #17460
In order to be able to run the SUID sandbox, which is good for security
and required to run Chromium with any kind of reasonable sandboxing when
using grsecurity kernels, we want to be able to control where the
sandbox comes from in the Chromium wrapper. This commit patches the
appropriate bit of source and adds the same old sandbox to the wrapper
(so it should be a no-op)
commit33557acb36ffb60317775ab7fdb3451a47b69d62
authorobadz <obadz-git@obadz.com>
dateThu 4 Aug 2016, 20:26 (10 years ago)
parent672447f
pkgs/applications/networking/browsers/chromium/common.nix+6
@@ -134,6 +134,12 @@ let
134134 ];
135135
136136 postPatch = ''
137+ # We want to be able to specify where the sandbox is via CHROME_DEVEL_SANDBOX
138+ substituteInPlace sandbox/linux/suid/client/setuid_sandbox_host.cc \
139+ --replace \
140+ 'std::string sandbox_binary(GetSandboxBinaryPath().value());' \
141+ 'std::string sandbox_binary(GetDevelSandboxPath());'
142+
137143 sed -i -r \
138144 -e 's/-f(stack-protector)(-all)?/-fno-\1/' \
139145 -e 's|/bin/echo|echo|' \
pkgs/applications/networking/browsers/chromium/default.nix+1
@@ -74,6 +74,7 @@ in stdenv.mkDerivation {
7474
7575 ln -s "${chromium.browser}/share" "$out/share"
7676 eval makeWrapper "${browserBinary}" "$out/bin/chromium" \
77+ --set CHROME_DEVEL_SANDBOX "${chromium.browser}/libexec/chromium/chrome-sandbox" \
7778 ${concatMapStringsSep " " getWrapperFlags chromium.plugins.enabled}
7879
7980 ln -s "$out/bin/chromium" "$out/bin/chromium-browser"