>>>>> On Wed, 05 Jun 2019, Michał Górny wrote:
> +# @FUNCTION: acct-group_pkg_pretend
> +# @DESCRIPTION:
> +# Performs sanity checks for correct eclass usage, and early-checks
> +# whether requested GID can be enforced.
> +acct-group_pkg_pretend() {
> + debug-print-function ${FUNCNAME} "${@}"
> +
> + # verify ACCT_GROUP_ID
> + [[ -n ${ACCT_GROUP_ID} ]] || die "Ebuild error: ACCT_GROUP_ID must be
> set!"
> + [[ ${ACCT_GROUP_ID} -ge 0 ]] || die "Ebuild errors:
> ACCT_GROUP_ID=${ACCT_GROUP_ID} invalid!"
Add a sanity check for [[ ${CATEGORY} == acct-group ]] too?
> +
> + # check for ACCT_GROUP_ID collisions early
> + if [[ -n ${ACCT_GROUP_ENFORCE_ID} ]]; then
> + local grp=$(egetent group "${ACCT_GROUP_ID}")
> + if [[ -n ${grp} ]]; then
> + eerror "The required GID is already taken by another
> group."
> + eerror " GID: ${ACCT_GROUP_ID} (needed for ${PN})"
> + eerror " current group: ${grp}"
> + die "GID ${ACCT_GROUP_ID} taken already"
> + fi
> + fi
> +}
> [...]
> +# @FUNCTION: acct-user_pkg_pretend
And a similar check for acct-user here.
Ulrich
signature.asc
Description: PGP signature
