On Mon, 2019-05-27 at 10:45 -0500, William Hubbs wrote: > If a package hard codes the UID or GID when adding a user or group to > the system and that UID/GID already exists, we should abort rather than > changing the UID/GID.
I think the major usage of this argument is not to enforce a specific
UID/GID but to specify a 'preferred' UID/GID, i.e. somewhat attempt
to build Gentoo systems with stable UID/GIDs. That's why it's non-
fatal.
I don't have a strong opinion on changing it. I don't know if we have
any actual use cases where UID/GID needs to be enforced.
> ---
> eclass/user.eclass | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/eclass/user.eclass b/eclass/user.eclass
> index f6a10a6bee2..0d0f9d9eb89 100644
> --- a/eclass/user.eclass
> +++ b/eclass/user.eclass
> @@ -130,7 +130,8 @@ enewuser() {
> if [[ -n ${euid} && ${euid} != -1 ]] ; then
> if [[ ${euid} -gt 0 ]] ; then
> if [[ -n $(egetent passwd ${euid}) ]] ; then
> - euid="next"
> + eerror "UID is already taken"
> + die "user ${euser} needs a new UID"
> fi
> else
> eerror "Userid given but is not greater than 0 !"
> @@ -290,7 +291,8 @@ enewgroup() {
> if [[ ! -z ${egid} ]] ; then
> if [[ ${egid} -gt 0 ]] ; then
> if [[ -n $(egetent group ${egid}) ]] ; then
> - egid="next available; requested gid taken"
> + eerror "GID is already taken"
> + die "group ${egroup} needs a new GID"
> fi
> else
> eerror "Groupid given but is not greater than 0 !"
--
Best regards,
Michał Górny
signature.asc
Description: This is a digitally signed message part
