From 40943fa6686db81b6805a4b1475a9d3ac2e0c82e Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Mon, 6 Jul 2015 20:57:49 +0200 Subject: Remove unused and unclear concept of secpass The secpass concept was inherited from Portage but the implementation disagrees with the current one in Portage. It is unclear and not used anywhere in pkgcore. Removing it seems the cleanest way forward. --- pkgcore/os_data.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pkgcore/os_data.py b/pkgcore/os_data.py index eb2e2d5b6..aa6c433d3 100644 --- a/pkgcore/os_data.py +++ b/pkgcore/os_data.py @@ -11,7 +11,7 @@ This will be killed off and bound into configuration subsystem at some point from __future__ import print_function __all__ = ( - "ostype", "portage_gid", "portage_uid", "root_gid", "root_uid", "secpass", + "ostype", "portage_gid", "portage_uid", "root_gid", "root_uid", "userland", "wheelgid", "xargs", ) @@ -39,20 +39,13 @@ elif ostype in ("FreeBSD", "OpenBSD", "NetBSD", "SunOS"): else: raise Exception("Operating system unsupported, '%s'" % ostype) -# Secpass will be set to 1 if the user is root or in the portage group. -secpass = 0 - uid = os.getuid() # hard coding sucks. root_uid = 0 root_gid = wheelgid = 0 -if uid == 0: - secpass = 2 try: wheelgid = grp.getgrnam("wheel").gr_gid - if (not secpass) and (wheelgid in os.getgroups()): - secpass = 1 except KeyError: pass @@ -62,9 +55,6 @@ try: portage_gid = grp.getgrnam("portage").gr_gid portage_user_groups = tuple(x.gr_name for x in grp.getgrall() if 'portage' in x.gr_mem) - - if secpass == 0: - secpass = 1 except KeyError: portage_uid = 0 portage_gid = wheelgid -- cgit v1.2.3-65-gdbad