Gentoo Archives: gentoo-dev

From: "Paweł Hajdan
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] RFC: check for enewuser, enewgroup outside of pkg_setup
Date: Wed, 19 Jan 2011 15:26:15
Message-Id: 4D37024F.7050605@gentoo.org
1 There was a discussion on irc about a package that called enewuser and
2 enewgroup from pkg_preinst. That made it fail on fresh install, because
3 the new user was needed at the src_install time (for ownership of the
4 installed files). However, if the user was already present on the
5 system, it was just a no-op, making the issue very hard to detect for
6 the package's maintainer or anyone who had it previously installed.
7
8 To avoid this type of problem in the future, I'd like to add the
9 following check:
10
11 "If enewuser or enewgroup is called from outside of pkg_setup, fail"
12
13 Initially I was thinking about a repoman check, but in theory someone
14 may extract code to a function called from pkg_setup, confusing the tool.
15
16 An alternative solution would be to make enewuser and enewgroup check
17 which ebuild phase called them, and fail if it's not pkg_setup
18 (important: that must happen before the check for existing user/group).
19
20 To make transition easy, we can make the error non-fatal for some time.
21
22 What do you think?

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies