From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A62C81381F3 for ; Sun, 12 May 2013 20:12:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6A096E08A1; Sun, 12 May 2013 20:12:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F1C30E08A1 for ; Sun, 12 May 2013 20:12:08 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CC87C33DF46 for ; Sun, 12 May 2013 20:12:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 6DF1EE53E0 for ; Sun, 12 May 2013 20:12:06 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1368389510.14d0196a227c0c648cf09d924c9a6bc61fa8704b.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/phase-functions.sh X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 14d0196a227c0c648cf09d924c9a6bc61fa8704b X-VCS-Branch: master Date: Sun, 12 May 2013 20:12:06 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 028daaac-252d-45ac-aab9-d7f3a51ec523 X-Archives-Hash: 153429e06281f9ad0eee7ee62379ceaf commit: 14d0196a227c0c648cf09d924c9a6bc61fa8704b Author: Zac Medico gentoo org> AuthorDate: Sun May 12 20:11:50 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun May 12 20:11:50 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=14d0196a filter_readonly_variables: safe cwd, bug #469338 --- bin/phase-functions.sh | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh index 76c97ac..ea717fe 100644 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -582,9 +582,13 @@ __dyn_install() { # local variables can leak into the saved environment. unset f + # Use safe cwd, avoiding unsafe import for bug #469338. + cd "${PORTAGE_PYM_PATH}" __save_ebuild_env --exclude-init-phases | __filter_readonly_variables \ - --filter-path --filter-sandbox --allow-extra-vars > environment + --filter-path --filter-sandbox --allow-extra-vars > \ + "${PORTAGE_BUILDDIR}"/build-info/environment assert "__save_ebuild_env failed" + cd "${PORTAGE_BUILDDIR}"/build-info || die ${PORTAGE_BZIP2_COMMAND} -f9 environment @@ -874,6 +878,8 @@ __ebuild_main() { if [[ -n $PORTAGE_UPDATE_ENV ]] ; then # Update environment.bz2 in case installation phases # need to pass some variables to uninstallation phases. + # Use safe cwd, avoiding unsafe import for bug #469338. + cd "${PORTAGE_PYM_PATH}" __save_ebuild_env --exclude-init-phases | \ __filter_readonly_variables --filter-path \ --filter-sandbox --allow-extra-vars \ @@ -974,6 +980,8 @@ __ebuild_main() { # Save the env only for relevant phases. if ! has "${1}" clean help info nofetch ; then umask 002 + # Use safe cwd, avoiding unsafe import for bug #469338. + cd "${PORTAGE_PYM_PATH}" __save_ebuild_env | __filter_readonly_variables \ --filter-features > "$T/environment" assert "__save_ebuild_env failed"