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 1QqZyE-0003TC-2Q for garchives@archives.gentoo.org; Tue, 09 Aug 2011 00:14:58 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 44C3E21C023; Tue, 9 Aug 2011 00:14:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1732821C023 for ; Tue, 9 Aug 2011 00:14:50 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9B6771B4036 for ; Tue, 9 Aug 2011 00:14:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id A82A180040 for ; Tue, 9 Aug 2011 00:14:48 +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: <8a85160f4833e3f02470961fc2e05ec93f466566.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/package/ebuild/doebuild.py X-VCS-Directories: pym/portage/package/ebuild/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 8a85160f4833e3f02470961fc2e05ec93f466566 Date: Tue, 9 Aug 2011 00:14:48 +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: 500579ef14d033fe26d2703c6af3e9f9 commit: 8a85160f4833e3f02470961fc2e05ec93f466566 Author: Zac Medico gentoo org> AuthorDate: Tue Aug 9 00:14:15 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Aug 9 00:14:15 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D8a85160f _check_temp_dir: check for 'portage' symlink This will fix bug #378403. --- pym/portage/package/ebuild/doebuild.py | 27 ++++++++++++++++++++++++--= - 1 files changed, 24 insertions(+), 3 deletions(-) diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package= /ebuild/doebuild.py index 49b67ac..a710e09 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -944,10 +944,31 @@ def _check_temp_dir(settings): # as some people use a separate PORTAGE_TMPDIR mount # we prefer that as the checks below would otherwise be pointless # for those people. - if os.path.exists(os.path.join(settings["PORTAGE_TMPDIR"], "portage")): - checkdir =3D os.path.join(settings["PORTAGE_TMPDIR"], "portage") + tmpdir =3D os.path.realpath(settings["PORTAGE_TMPDIR"]) + if os.path.exists(os.path.join(tmpdir, "portage")): + checkdir =3D os.path.realpath(os.path.join(tmpdir, "portage")) + if ("sandbox" in settings.features or + "usersandox" in settings.features) and \ + not checkdir.startswith(tmpdir + os.sep): + msg =3D _("The 'portage' subdirectory of the directory " + "referenced by the PORTAGE_TMPDIR variable appears to be " + "a symlink. In order to avoid sandbox violations (see bug " + "#378379), you must adjust PORTAGE_TMPDIR instead of using " + "the symlink located at '%s'. A suitable PORTAGE_TMPDIR " + "setting would be '%s'.") % \ + (os.path.join(tmpdir, "portage"), checkdir) + lines =3D [] + lines.append("") + lines.append("") + lines.extend(wrap(msg, 72)) + lines.append("") + for line in lines: + if line: + line =3D "!!! %s" % (line,) + writemsg("%s\n" % (line,), noiselevel=3D-1) + return 1 else: - checkdir =3D settings["PORTAGE_TMPDIR"] + checkdir =3D tmpdir =20 if not os.access(checkdir, os.W_OK): writemsg(_("%s is not writable.\n"