aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-02-29 21:58:00 -0800
committerZac Medico <zmedico@gentoo.org>2020-02-29 21:58:46 -0800
commitec654122c0eb191c90ffb2c191403d342dbc361e (patch)
tree37dbbeb67a317ef893afbad4749fe66391c8081b /lib/_emerge
parentSupport PORTAGE_LOG_FILTER_FILE (bug 709746) (diff)
downloadportage-ec654122c0eb191c90ffb2c191403d342dbc361e.tar.gz
portage-ec654122c0eb191c90ffb2c191403d342dbc361e.tar.bz2
portage-ec654122c0eb191c90ffb2c191403d342dbc361e.zip
fetch: drop privileges early for NFS root_squash (bug 601252)
Drop privileges prior to fetch function calls, so that all necessary operations can succeed when DISTDIR is on NFS with root_squash enabled. Bug: https://bugs.gentoo.org/601252 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge')
-rw-r--r--lib/_emerge/EbuildFetcher.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/_emerge/EbuildFetcher.py b/lib/_emerge/EbuildFetcher.py
index c9e03dc97..d315d4f02 100644
--- a/lib/_emerge/EbuildFetcher.py
+++ b/lib/_emerge/EbuildFetcher.py
@@ -12,7 +12,12 @@ from portage import _unicode_encode
from portage import _unicode_decode
from portage.checksum import _hash_filter
from portage.elog.messages import eerror
-from portage.package.ebuild.fetch import _check_distfile, fetch
+from portage.package.ebuild.fetch import (
+ _check_distfile,
+ _drop_privs_userfetch,
+ _want_userfetch,
+ fetch,
+)
from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
from portage.util._async.ForkProcess import ForkProcess
from portage.util.futures.compat_coroutine import coroutine
@@ -239,6 +244,11 @@ class _EbuildFetcherProcess(ForkProcess):
portage.output.havecolor = self._settings.get('NOCOLOR') \
not in ('yes', 'true')
+ # For userfetch, drop privileges for the entire fetch call, in
+ # order to handle DISTDIR on NFS with root_squash for bug 601252.
+ if _want_userfetch(self._settings):
+ _drop_privs_userfetch(self._settings)
+
rval = 1
allow_missing = self._get_manifest().allow_missing or \
'digest' in self._settings.features