INCREMENTALS, EAPI, MISC_SH_BINARY
from portage_data import ostype, lchown, userland, secpass, uid, wheelgid, \
- portage_uid, portage_gid
+ portage_uid, portage_gid, userpriv_groups
from portage_manifest import Manifest
import portage_util
("userpriv" in string.split(mysettings["RESTRICT"]))))
if droppriv and not uid and portage_gid and portage_uid:
- keywords.update({"uid":portage_uid,"gid":portage_gid,"groups":[portage_gid],"umask":002})
+ keywords.update({"uid":portage_uid,"gid":portage_gid,"groups":userpriv_groups,"umask":002})
if not free:
free=((droppriv and "usersandbox" not in features) or \
spawn_keywords.update({
"uid" : portage_uid,
"gid" : portage_gid,
- "groups" : [portage_gid],
+ "groups" : userpriv_groups,
"umask" : 002})
try:
# Distributed under the terms of the GNU General Public License v2
# $Id$
+if not hasattr(__builtins__, "set"):
+ from sets import Set as set
import os,pwd,grp
from portage_util import writemsg
writemsg(red("*** Please add this user to the portage group if you wish to use portage.\n"))
writemsg("\n")
portage_group_warning()
+
+userpriv_groups = [portage_gid]
+if secpass >= 2:
+ for g in grp.getgrall():
+ if "portage" in g[3]:
+ userpriv_groups.append(g[2])
+ userpriv_groups = list(set(userpriv_groups))