Hello all, I noticed that the current user.eclass's implementation of euseradd depends on the value of 'USERGROUPS_ENAB' in /etc/login.defs. Speaking to several developers in #gentoo-dev, it seems that an ebuild writer is suppose to call both 'enewuser' and 'enewgroup' in order to add an user or a group, rather than depending on enewuser to automatically add a group. Reading 'man useradd', the -r flag means that a system account will be created and a home directory will not be created unless -m is also use. It also says that it will ignore login.defs specifically when speaking about creating a home directory. However, it doesn't say anything about ignoring login.defs for group creation when an user is added (Which makes the above effect take place). In order so solve this, the 'enewuser' function should be modified so that it doesn't depend on login.defs, but rather to make sure that a group is not added and only a user. Line 250 would need to change from: useradd -r "${opts[@]}" "${euser}" || die to useradd -N -r "${opts[@]}" "${euser}" || die with -N meaning: -N, --no-user-group do not create a group with the same name as the user Doing this will make the eclass function as it was originally intended (To only create an user, and not a group - and to assume that if the ebuild writer wants to create a group, then they will call enewgroup manually). However, if we do this, we need to know that any ebuilds that didn't "properly implement" (as defined by the above assumptions) user/group adding, will break. - fearedbliss
enewuser isn't relying on that behavior. it just shouldn't happen at all.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3afc0d7b8b5e90c50d66c5a845b96c33e521e6e8 commit 3afc0d7b8b5e90c50d66c5a845b96c33e521e6e8 Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2019-05-29 17:42:07 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2019-06-20 08:16:37 +0000 user.eclass: Do not create user-group automatically Closes: https://bugs.gentoo.org/512220 Signed-off-by: Michał Górny <mgorny@gentoo.org> eclass/user.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)