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 1Rdo2N-0002XN-G3 for garchives@archives.gentoo.org; Thu, 22 Dec 2011 19:10:43 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 692DE21C256; Thu, 22 Dec 2011 19:10:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3AFDF21C256 for ; Thu, 22 Dec 2011 19:10:31 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 88F30642C2 for ; Thu, 22 Dec 2011 19:10:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id E728C80042 for ; Thu, 22 Dec 2011 19:10:29 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/package/ebuild/fetch.py X-VCS-Directories: pym/portage/package/ebuild/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: a34586a73724d6075a556f82a05fc16893db31e0 Date: Thu, 22 Dec 2011 19:10:29 +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: 5e46a496-a5b2-4593-b8c5-8d0f04a7bd19 X-Archives-Hash: 74465b45c526276c74f915d4ed624944 commit: a34586a73724d6075a556f82a05fc16893db31e0 Author: Zac Medico gentoo org> AuthorDate: Thu Dec 22 19:10:18 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Dec 22 19:10:18 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Da34586a7 fetch: don't apply permissions to symlinks We don't want to modify anything outside of the primary DISTDIR, and symlinks typically point to PORTAGE_RO_DISTDIRS. This will fix bug #395705. --- pym/portage/package/ebuild/fetch.py | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/eb= uild/fetch.py index 70743bf..c67f3c4 100644 --- a/pym/portage/package/ebuild/fetch.py +++ b/pym/portage/package/ebuild/fetch.py @@ -633,7 +633,10 @@ def fetch(myuris, mysettings, listonly=3D0, fetchonl= y=3D0, match, mystat =3D _check_distfile( myfile_path, pruned_digests, eout) if match: - if distdir_writable: + # Skip permission adjustment for symlinks, since we don't + # want to modify anything outside of the primary DISTDIR, + # and symlinks typically point to PORTAGE_RO_DISTDIRS. + if distdir_writable and not os.path.islink(myfile_path): try: apply_secpass_permissions(myfile_path, gid=3Dportage_gid, mode=3D0o664, mask=3D0o2, @@ -747,14 +750,18 @@ def fetch(myuris, mysettings, listonly=3D0, fetchon= ly=3D0, raise del e else: - try: - apply_secpass_permissions( - myfile_path, gid=3Dportage_gid, mode=3D0o664, mask=3D0o2, - stat_cached=3Dmystat) - except PortageException as e: - if not os.access(myfile_path, os.R_OK): - writemsg(_("!!! Failed to adjust permissions:" - " %s\n") % str(e), noiselevel=3D-1) + # Skip permission adjustment for symlinks, since we don't + # want to modify anything outside of the primary DISTDIR, + # and symlinks typically point to PORTAGE_RO_DISTDIRS. + if not os.path.islink(myfile_path): + try: + apply_secpass_permissions(myfile_path, + gid=3Dportage_gid, mode=3D0o664, mask=3D0o2, + stat_cached=3Dmystat) + except PortageException as e: + if not os.access(myfile_path, os.R_OK): + writemsg(_("!!! Failed to adjust permissions:" + " %s\n") % (e,), noiselevel=3D-1) =20 # If the file is empty then it's obviously invalid. Remove # the empty file and try to download if possible.