Created attachment 354806 [details, diff]
Patch to make user.eclass respect $ROOT when manipulating users / groups
When using emerge to install packages to a root other than / the user manipulation functions in user.eclass do not respect the $ROOT variable and thus create / manipulate the users / groups of the host system instead.
The supplied patch resolves this issue.
1) I have added
to the top of user.eclass as without this merges which use these functions will fail due to missing files in $ROOT/etc/pam.d
2) I have added extra einfo output to make debugging any potential problems easier - feel free to remove these if you wish.
3) These fixes are for Gentoo only and do NOT resolve the problems on other distributions, such as darwin, netbsd, etc.
4) The patch has been well tested as we use it to automate building stages for (automated) Xen VM deployment so we know it works! :-)
I hope this is of some assistance. Keep up the good work.
*** This bug has been marked as a duplicate of bug 53269 ***