Gentoo Archives: gentoo-dev

From: Michael Orlitzky <mjo@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Requirements for UID/GID management
Date: Sat, 28 Jan 2017 03:20:19
Message-Id: 3f75b35c-8f39-9f7a-1e0c-e992853e91df@gentoo.org
In Reply to: Re: [gentoo-dev] Requirements for UID/GID management by Patrick McLean
1 On 01/27/2017 09:37 PM, Patrick McLean wrote:
2 >
3 > To make something to solve our problem (and I suspect everyone
4 > else who cares about this), it would be sufficient to have a mechanism
5 > to override the default random assignment with a fixed UID/GID.
6
7 What I had in mind for this is that a "normal" user ebuild would look
8 like...
9
10 EAPI=6
11 # SYS_USER_NAME defaults to ${PN}
12 SYS_USER_GROUPS="foo" # defaults empty or to ${PN}, not sure
13 # SYS_USER_UID left undefined to get the next available
14 # SYS_USER_HOME left undefined to get the default
15 # SYS_USER_SHELL left undefined... etc.
16 inherit sys-user.eclass
17 ...
18 # DEPEND set to "sys-group/foo" by the eclass
19 # RDEPEND set to "sys-group/foo" by the eclass
20 ...
21 # src_install and pkg_prerm from the eclass.
22
23 To override the UID behavior, I think package.env would work, but an
24 overlay where the ebuild has SYS_USER_UID=42 is guaranteed to.