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
please search *** This bug has been marked as a duplicate of bug 42320 ***