From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QE2yi-0008Eu-Gf for garchives@archives.gentoo.org; Sun, 24 Apr 2011 17:20:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 13D211C018; Sun, 24 Apr 2011 17:20:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id DB5101C018 for ; Sun, 24 Apr 2011 17:20:04 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4EB831B4002 for ; Sun, 24 Apr 2011 17:20:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 75471803E3 for ; Sun, 24 Apr 2011 17:20:03 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: Subject: [gentoo-commits] proj/portage:prefix commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/misc-functions.sh X-VCS-Directories: bin/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: be225af8d9aeb6a839f8ff231cbee61d3be45e0f Date: Sun, 24 Apr 2011 17:20:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 7aa6b1302f57e2ec8baca0736e41dcda commit: be225af8d9aeb6a839f8ff231cbee61d3be45e0f Author: Michael Haubenwallner gentoo org> AuthorDate: Sun Apr 24 17:18:03 2011 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Apr 24 17:18:03 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dbe225af8 shebang check: ignore symlinks that point outside the prefix As documented in bug #282539, we can have symlinks that point outside the prefix. The targets of those files need not to be checked for their shebang, as they are obviously not under our control. Signed-off-by: Fabian Groffen gentoo.org> --- bin/misc-functions.sh | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 59cc9d4..3bf5060 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -800,15 +800,18 @@ install_qa_check_prefix() { IFS=3D${oldIFS} [[ ${WHITELIST} =3D=3D *" ${line[0]} "* ]] && continue local fp=3D${fn#${D}} ; fp=3D/${fp%/*} + # line[0] can be an absolutised path, bug #342929 + local eprefix=3D$(canonicalize ${EPREFIX}) local rf=3D${fn} # in case we deal with a symlink, make sure we don't replace it # with a real file (sed -i does that) if [[ -L ${fn} ]] ; then rf=3D$(readlink ${fn}) [[ ${rf} !=3D /* ]] && rf=3D${fn%/*}/${rf} + # ignore symlinks pointing to outside prefix + # as seen in sys-devel/native-cctools + [[ ${rf} !=3D ${EPREFIX}/* && $(canonicalize "${rf}") !=3D ${eprefix}= /* ]] && continue fi - # line[0] can be an absolutised path, bug #342929 - local eprefix=3D$(canonicalize ${EPREFIX}) # does the shebang start with ${EPREFIX}, and does it exist? if [[ ${line[0]} =3D=3D ${EPREFIX}/* || ${line[0]} =3D=3D ${eprefix}/*= ]] ; then if [[ ! -e ${ROOT%/}${line[0]} && ! -e ${D%/}${line[0]} ]] ; then