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 1QgYZI-0002kK-Gb for garchives@archives.gentoo.org; Tue, 12 Jul 2011 08:43:48 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5DE1921C03A; Tue, 12 Jul 2011 08:43:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2C69F21C03A for ; Tue, 12 Jul 2011 08:43:41 +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 B90DA2AC0BB for ; Tue, 12 Jul 2011 08:43:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 20C488003D for ; Tue, 12 Jul 2011 08:43:40 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <5bcd5b16d08ae263e9973196f144b72b8c7b7d0a.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/portagepm/, gentoopm/basepm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/basepm/config.py gentoopm/portagepm/config.py X-VCS-Directories: gentoopm/portagepm/ gentoopm/basepm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 5bcd5b16d08ae263e9973196f144b72b8c7b7d0a Date: Tue, 12 Jul 2011 08:43:40 +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: 56f08aebc784a8b8fb71040bc80ac6fb commit: 5bcd5b16d08ae263e9973196f144b72b8c7b7d0a Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Tue Jul 12 08:44:18 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Tue Jul 12 08:44:18 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3D5bcd5b16 Portage: support grabbing userpriv from config. --- gentoopm/basepm/config.py | 27 ++++++++++++++++++++++++++- gentoopm/portagepm/config.py | 14 ++++++++++++++ 2 files changed, 40 insertions(+), 1 deletions(-) diff --git a/gentoopm/basepm/config.py b/gentoopm/basepm/config.py index 90dbb67..d011001 100644 --- a/gentoopm/basepm/config.py +++ b/gentoopm/basepm/config.py @@ -8,4 +8,29 @@ from abc import abstractproperty from gentoopm.util import ABCObject =20 class PMConfig(ABCObject): - pass + @abstractproperty + def userpriv_enabled(self): + """ + Check whether root privileges are dropped for build-time. + + @type: bool + """ + pass + + @abstractproperty + def userpriv_uid(self): + """ + The UID used for userpriv. + + @type: string/numeric + """ + pass + + @abstractproperty + def userpriv_gid(self): + """ + The GID used for userpriv. + + @type: string/numeric + """ + pass diff --git a/gentoopm/portagepm/config.py b/gentoopm/portagepm/config.py index 5f80506..5bb697d 100644 --- a/gentoopm/portagepm/config.py +++ b/gentoopm/portagepm/config.py @@ -3,8 +3,22 @@ # (c) 2011 Micha=C5=82 G=C3=B3rny # Released under the terms of the 2-clause BSD license. =20 +import portage.data + from gentoopm.basepm.config import PMConfig =20 class PortageConfig(PMConfig): def __init__(self, settings): self._settings =3D settings + + @property + def userpriv_enabled(self): + return 'userpriv' in self._settings.features + + @property + def userpriv_uid(self): + return portage.data.portage_uid + + @property + def userpriv_gid(self): + return portage.data.portage_gid