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 1Rx5au-0001wH-RT for garchives@archives.gentoo.org; Mon, 13 Feb 2012 23:46:05 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9DD13E08B8; Mon, 13 Feb 2012 23:45:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 609A0E08B8 for ; Mon, 13 Feb 2012 23:45:57 +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 399771B400E for ; Mon, 13 Feb 2012 23:45:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 427A7E5400 for ; Mon, 13 Feb 2012 23:45:54 +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: <1329176321.6d2a73d7f78dac986539c0c6b841cc499c2088e6.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/config.py pym/portage/package/ebuild/doebuild.py 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: 6d2a73d7f78dac986539c0c6b841cc499c2088e6 X-VCS-Branch: master Date: Mon, 13 Feb 2012 23:45:54 +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: 49ba77ec-d739-4a39-98ac-2670f8c776e3 X-Archives-Hash: c20aef4c79e1b7c0d634597cf4541710 commit: 6d2a73d7f78dac986539c0c6b841cc499c2088e6 Author: Zac Medico gentoo org> AuthorDate: Mon Feb 13 23:38:41 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Feb 13 23:38:41 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D6d2a73d7 Handle missing os.setgroups for PyPy. See https://bugs.pypy.org/issue833 for details. --- pym/portage/package/ebuild/config.py | 17 +++++++++++++++++ pym/portage/package/ebuild/doebuild.py | 3 ++- pym/portage/package/ebuild/fetch.py | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/e= build/config.py index 366f548..4304e09 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -938,6 +938,23 @@ class config(object): writemsg(_("!!! FEATURES=3Dfakeroot is enabled, but the " "fakeroot binary is not installed.\n"), noiselevel=3D-1) =20 + if os.getuid() =3D=3D 0 and not hasattr(os, "setgroups"): + warning_shown =3D False + + if "userpriv" in self.features: + writemsg(_("!!! FEATURES=3Duserpriv is enabled, but " + "os.setgroups is not available.\n"), noiselevel=3D-1) + warning_shown =3D True + + if "userfetch" in self.features: + writemsg(_("!!! FEATURES=3Duserfetch is enabled, but " + "os.setgroups is not available.\n"), noiselevel=3D-1) + warning_shown =3D True + + if warning_shown and platform.python_implementation() =3D=3D 'PyPy': + writemsg(_("!!! See https://bugs.pypy.org/issue833 for details.\n"), + noiselevel=3D-1) + def load_best_module(self,property_string): best_mod =3D best_from_dict(property_string,self.modules,self.module_p= riority) mod =3D None diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package= /ebuild/doebuild.py index c52ab31..c45aa03 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -1388,7 +1388,8 @@ def spawn(mystring, mysettings, debug=3D0, free=3D0= , droppriv=3D0, sesandbox=3D0, fakero # fake ownership/permissions will have to be converted to real # permissions in the merge phase. fakeroot =3D fakeroot and uid !=3D 0 and portage.process.fakeroot_capab= le - if droppriv and not uid and portage_gid and portage_uid: + if droppriv and uid =3D=3D 0 and portage_gid and portage_uid and \ + hasattr(os, "setgroups"): keywords.update({"uid":portage_uid,"gid":portage_gid, "groups":userpriv_groups,"umask":0o02}) if not free: diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/eb= uild/fetch.py index c67f3c4..8c20b71 100644 --- a/pym/portage/package/ebuild/fetch.py +++ b/pym/portage/package/ebuild/fetch.py @@ -66,7 +66,8 @@ def _spawn_fetch(settings, args, **kwargs): } =20 if "userfetch" in settings.features and \ - os.getuid() =3D=3D 0 and portage_gid and portage_uid: + os.getuid() =3D=3D 0 and portage_gid and portage_uid and \ + hasattr(os, "setgroups"): kwargs.update(_userpriv_spawn_kwargs) =20 spawn_func =3D spawn