public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/, bin/
Date: Sun, 12 May 2013 11:16:45 +0000 (UTC)	[thread overview]
Message-ID: <1368357323.3f3bd1762f48bafe7e48729048cdd9d7d86c7fca.zmedico@gentoo> (raw)

commit:     3f3bd1762f48bafe7e48729048cdd9d7d86c7fca
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 12 11:09:14 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 12 11:15:23 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3f3bd176

ebuild-ipc: use safe cwd for import, bug #469338

---
 bin/ebuild-helpers/portageq |    4 +++-
 bin/ebuild-ipc              |    4 +++-
 bin/phase-helpers.sh        |   23 ++++++++---------------
 3 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/bin/ebuild-helpers/portageq b/bin/ebuild-helpers/portageq
index ec30b66..7bd330b 100755
--- a/bin/ebuild-helpers/portageq
+++ b/bin/ebuild-helpers/portageq
@@ -1,8 +1,10 @@
 #!/bin/bash
-# Copyright 2009-2010 Gentoo Foundation
+# Copyright 2009-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
 PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
+# Use safe cwd, avoiding unsafe import for bug #469338.
+cd "${PORTAGE_PYM_PATH}"
 PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
 	exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/portageq" "$@"

diff --git a/bin/ebuild-ipc b/bin/ebuild-ipc
index 43e4a02..9ff6f1c 100755
--- a/bin/ebuild-ipc
+++ b/bin/ebuild-ipc
@@ -1,8 +1,10 @@
 #!/bin/bash
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
 PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
+# Use safe cwd, avoiding unsafe import for bug #469338.
+cd "${PORTAGE_PYM_PATH}"
 PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
 	exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/ebuild-ipc.py" "$@"

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 4812db3..a97323a 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 export DESTTREE=/usr
@@ -683,8 +683,7 @@ has_version() {
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
 		"$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "${atom}"
 	else
-		PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${eroot}" "${atom}"
+		"${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" has_version "${eroot}" "${atom}"
 	fi
 	local retval=$?
 	case "${retval}" in
@@ -736,8 +735,7 @@ best_version() {
 	if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
 		"$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "${atom}"
 	else
-		PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-		"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" best_version "${eroot}" "${atom}"
+		"${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" best_version "${eroot}" "${atom}"
 	fi
 	local retval=$?
 	case "${retval}" in
@@ -766,8 +764,7 @@ if ___eapi_has_master_repositories; then
 		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
 			"${PORTAGE_BIN_PATH}/ebuild-ipc" master_repositories "${EROOT}" "${repository}"
 		else
-			output=$(PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-			"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" master_repositories "${EROOT}" "${repository}")
+			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" master_repositories "${EROOT}" "${repository}")
 		fi
 		retval=$?
 		[[ -n ${output} ]] && echo "${output}"
@@ -798,8 +795,7 @@ if ___eapi_has_repository_path; then
 		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
 			"${PORTAGE_BIN_PATH}/ebuild-ipc" repository_path "${EROOT}" "${repository}"
 		else
-			output=$(PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-			"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" get_repo_path "${EROOT}" "${repository}")
+			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" get_repo_path "${EROOT}" "${repository}")
 		fi
 		retval=$?
 		[[ -n ${output} ]] && echo "${output}"
@@ -829,8 +825,7 @@ if ___eapi_has_available_eclasses; then
 		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
 			"${PORTAGE_BIN_PATH}/ebuild-ipc" available_eclasses "${EROOT}" "${repository}"
 		else
-			output=$(PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-			"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" available_eclasses "${EROOT}" "${repository}")
+			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" available_eclasses "${EROOT}" "${repository}")
 		fi
 		retval=$?
 		[[ -n ${output} ]] && echo "${output}"
@@ -861,8 +856,7 @@ if ___eapi_has_eclass_path; then
 		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
 			"${PORTAGE_BIN_PATH}/ebuild-ipc" eclass_path "${EROOT}" "${repository}" "${eclass}"
 		else
-			output=$(PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-			"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" eclass_path "${EROOT}" "${repository}" "${eclass}")
+			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" eclass_path "${EROOT}" "${repository}" "${eclass}")
 		fi
 		retval=$?
 		[[ -n ${output} ]] && echo "${output}"
@@ -893,8 +887,7 @@ if ___eapi_has_license_path; then
 		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
 			"${PORTAGE_BIN_PATH}/ebuild-ipc" license_path "${EROOT}" "${repository}" "${license}"
 		else
-			output=$(PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-			"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" license_path "${EROOT}" "${repository}" "${license}")
+			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" license_path "${EROOT}" "${repository}" "${license}")
 		fi
 		retval=$?
 		[[ -n ${output} ]] && echo "${output}"


             reply	other threads:[~2013-05-12 11:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-12 11:16 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-01 11:14 [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/, bin/ Ulrich Müller
2023-10-21 19:23 Ulrich Müller
2021-05-24  4:55 Zac Medico
2018-09-20 18:49 Michał Górny
2018-03-28  5:19 Zac Medico
2018-03-04 21:05 Michał Górny
2014-12-04 14:01 Michał Górny
2014-08-19  7:01 Michał Górny
2014-08-10  0:10 Brian Dolbec
2013-05-12 20:47 Zac Medico
2012-12-11  9:01 Zac Medico
2012-11-22 22:06 Mike Frysinger
2012-09-26 20:33 Arfrever Frehtes Taifersar Arahesis
2012-09-14  7:26 Zac Medico
2012-09-14  7:26 Zac Medico
2012-09-02 22:57 Zac Medico
2012-08-15 20:45 Ulrich Mueller
2012-05-12  4:09 Mike Frysinger
2011-07-08 17:15 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368357323.3f3bd1762f48bafe7e48729048cdd9d7d86c7fca.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox