On 6/5/19 5:12 AM, Michał Górny wrote:
> +
> +     # check for ACCT_USER_ID collisions early
> +     if [[ -n ${ACCT_USER_ENFORCE_ID} ]]; then
> +             local pwd=$(egetent passwd "${ACCT_USER_ID}")
> +             if [[ -n ${pwd} ]]; then
> +                     eerror "The required UID is already taken by another 
> user."
> +                     eerror "  UID: ${ACCT_USER_ID} (needed for ${PN})"
> +                     eerror "  current user: ${pwd}"
> +                     die "UID ${ACCT_USER_ID} taken already"
> +             fi
> +     fi
> +}

If we set ACCT_USER_ENFORCE_ID=true in ftp-0.ebuild and then "emerge
acct-user/ftp" again, the second one dies with

  * The required UID is already taken by another user.
  *   UID: 21 (needed for ftp)

This prevents "emerge -e @world" from working, and would prevent an
upgrade to ftp-1.ebuild in the future.

We could augment the checks to ignore the existing user/group if its
name agrees with the one we're trying to create, but now I'm having deja
vu. I think this is another reason why I decided to go with a dummy file
installed under /var/lib to catch collisions: the PM will necessarily
ignore collisions from the same package.

Reply via email to