Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 368490 Details for
Bug 344307
portage doesn't work if the user's group id is numeric
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
portage-numeric-group.patch
portage-numeric-gid.patch (text/plain), 3.30 KB, created by
Ruud Koolen (RETIRED)
on 2014-01-22 23:45:44 UTC
(
hide
)
Description:
portage-numeric-group.patch
Filename:
MIME Type:
Creator:
Ruud Koolen (RETIRED)
Created:
2014-01-22 23:45:44 UTC
Size:
3.30 KB
patch
obsolete
>diff --git a/pym/portage/data.py b/pym/portage/data.py >index 4c92b8d..b6f53cf 100644 >--- a/pym/portage/data.py >+++ b/pym/portage/data.py >@@ -92,21 +92,28 @@ def _get_global(k): > #Discover the uid and gid of the portage user/group > keyerror = False > try: >- portage_uid = pwd.getpwnam(_get_global('_portage_username')).pw_uid >+ username = str(_get_global('_portage_username')) >+ portage_uid = pwd.getpwnam(username).pw_uid > except KeyError: > # PREFIX LOCAL: some sysadmins are insane, bug #344307 >- if _portage_grpname.isdigit(): >- portage_gid = int(_portage_grpname) >+ if username.isdigit(): >+ portage_uid = int(username) > else: > keyerror = True >+ portage_uid = 0 > # END PREFIX LOCAL >- portage_uid = 0 > > try: >- portage_gid = grp.getgrnam(_get_global('_portage_grpname')).gr_gid >+ grpname = str(_get_global('_portage_grpname')) >+ portage_gid = grp.getgrnam(grpname).gr_gid > except KeyError: >- keyerror = True >- portage_gid = 0 >+ # PREFIX LOCAL: some sysadmins are insane, bug #344307 >+ if grpname.isdigit(): >+ portage_gid = int(grpname) >+ else: >+ keyerror = True >+ portage_gid = 0 >+ # END PREFIX LOCAL > > if secpass < 1 and portage_gid in os.getgroups(): > secpass = 1 >@@ -204,14 +211,14 @@ def _get_global(k): > try: > grp_struct = grp.getgrgid(eroot_st.st_gid) > except KeyError: >- pass >+ v = eroot_st.st_gid > else: > v = grp_struct.gr_name > else: > try: > pwd_struct = pwd.getpwuid(eroot_st.st_uid) > except KeyError: >- pass >+ v = eroot_st.st_uid > else: > v = pwd_struct.pw_name > >diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py >index 374cc9a..ad1f0be 100644 >--- a/pym/portage/package/ebuild/doebuild.py >+++ b/pym/portage/package/ebuild/doebuild.py >@@ -1528,6 +1528,8 @@ def spawn(mystring, mysettings, debug=False, free=False, droppriv=False, > user = "root" > elif portage_build_uid == portage_uid: > user = portage.data._portage_username >+ else: >+ user = portage_uid > if user is not None: > mysettings["PORTAGE_BUILD_USER"] = user > >@@ -1540,6 +1542,8 @@ def spawn(mystring, mysettings, debug=False, free=False, droppriv=False, > group = "root" > elif portage_build_gid == portage_gid: > group = portage.data._portage_grpname >+ else: >+ group = portage_gid > if group is not None: > mysettings["PORTAGE_BUILD_GROUP"] = group > >diff --git a/pym/portage/tests/runTests b/pym/portage/tests/runTests >index 118e289..82eeece 100755 >--- a/pym/portage/tests/runTests >+++ b/pym/portage/tests/runTests >@@ -24,8 +24,14 @@ signal.signal(debug_signum, debug_signal) > # Pretend that the current user's uid/gid are the 'portage' uid/gid, > # so things go smoothly regardless of the current user and global > # user/group configuration. >-os.environ["PORTAGE_USERNAME"] = pwd.getpwuid(os.getuid()).pw_name >-os.environ["PORTAGE_GRPNAME"] = grp.getgrgid(os.getgid()).gr_name >+try: >+ os.environ["PORTAGE_USERNAME"] = pwd.getpwuid(os.getuid()).pw_name >+except KeyError: >+ os.environ["PORTAGE_USERNAME"] = str(os.getuid()) >+try: >+ os.environ["PORTAGE_GRPNAME"] = grp.getgrgid(os.getgid()).gr_name >+except KeyError: >+ os.environ["PORTAGE_GRPNAME"] = str(os.getgid()) > > # Insert our parent dir so we can do shiny import "tests" > # This line courtesy of Marienz and Pkgcore ;)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 344307
:
253329
|
253331
|
255981
|
368474
| 368490