There was a discussion on irc about a package that called enewuser and
enewgroup from pkg_preinst. That made it fail on fresh install, because
the new user was needed at the src_install time (for ownership of the
installed files). However, if the user was already present on the
system, it was just a no-op, making the issue very hard to detect for
the package's maintainer or anyone who had it previously installed.

To avoid this type of problem in the future, I'd like to add the
following check:

"If enewuser or enewgroup is called from outside of pkg_setup, fail"

Initially I was thinking about a repoman check, but in theory someone
may extract code to a function called from pkg_setup, confusing the tool.

An alternative solution would be to make enewuser and enewgroup check
which ebuild phase called them, and fail if it's not pkg_setup
(important: that must happen before the check for existing user/group).

To make transition easy, we can make the error non-fatal for some time.

What do you think?

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to