commit:     656f8a7fcd2014c833e42282744c70a21e6c7e31
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  8 23:51:52 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug  8 23:55:19 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=656f8a7f

treewalk: reset config for unmerge (bug 711174)

When cloning config instances for unmerge, call the reset
method in order to ensure that there is no unintended leakage
of variables which should not be shared. This fixes leakage
of the PORTAGE_LOG_FILE variable, which triggered log
corruption for FEATURES=compress-build-logs.

Bug: https://bugs.gentoo.org/711174
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/dbapi/vartree.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py
index 5799d94f2..3eee025ad 100644
--- a/lib/portage/dbapi/vartree.py
+++ b/lib/portage/dbapi/vartree.py
@@ -4013,7 +4013,9 @@ class dblink:
                                # since we need it to have private ${T} etc... 
for things
                                # like elog.
                                settings_clone = 
portage.config(clone=self.settings)
-                               settings_clone.pop("PORTAGE_BUILDDIR_LOCKED", 
None)
+                               # This reset ensures that there is no 
unintended leakage
+                               # of variables which should not be shared.
+                               settings_clone.reset()
                                settings_clone.setcpv(cur_cpv, 
mydb=self.vartree.dbapi)
                                if self._preserve_libs and "preserve-libs" in \
                                        
settings_clone["PORTAGE_RESTRICT"].split():

Reply via email to