Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 389159 - eutils.eclass enewgroup/enewuser does not use the correct /etc/passwd and /etc/groups file when ROOT is set manually
Summary: eutils.eclass enewgroup/enewuser does not use the correct /etc/passwd and /et...
Status: RESOLVED DUPLICATE of bug 42320
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-01 07:56 UTC by Nicolas Perrenoud
Modified: 2011-11-01 17:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Perrenoud 2011-11-01 07:56:33 UTC
When using the ROOT environment variable to choose an alternative system root directory (e.g. when creating a customized distribution), ebuild does add users and groups to the respective /etc... files in the host/original system and not the system located in /ROOT. The functions affected are enewgroup/enewuser in the eutils.eclass file. 
This happens because useraddadd and groupadd of the sys-apps/shadow package have the paths to /etc/passwd and /etc/groups hard-compiled.

Reproducible: Always

Steps to Reproduce:
1. ROOT=/bla emerge -av baselayout openssh
2. cat /etc/passwd | grep sshd
3. cat /bla/etc/passwd | grep sshd



Possible solutions: 
If ROOT is set and != /
- circumvent the use of useradd/groupadd and write directly to $ROOT/etc/passwd (consider $ROOT/etc/shadows for passwords)
- patch useradd/groupadd and add a new option to specify the root directory
Comment 1 SpanKY gentoo-dev 2011-11-01 17:18:44 UTC
please search

*** This bug has been marked as a duplicate of bug 42320 ***