Gentoo Archives: gentoo-dev

From: Jaco Kroon <jaco@××××××.za>
To: gentoo-dev@l.g.o, "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-dev] dynamic groups and users
Date: Fri, 02 Aug 2019 09:15:12
Message-Id: 2a95f00b-f195-5ed9-3737-886e68039da9@uls.co.za
In Reply to: Re: [gentoo-dev] dynamic groups and users by "Michał Górny"
1 Thank you Michał, much appreciated.
2
3 I've in the meantime to make progress on my side picked something which
4 was not in use in ::gentoo, so I can move forward, but it's be really
5 good to have the below feature anyway going forward.
6
7 On 2019/08/01 22:47, Michał Górny wrote:
8 > On Thu, 2019-08-01 at 21:04 +0200, Jaco Kroon wrote:
9 >> Hi,
10 >>
11 >> Looking at the new eclasses for acct-user and acct-group.
12 >>
13 >> These enforce that a group and user id should be set.
14 >>
15 >> This is not a requirement for enewuser nor enewgroup.
16 >>
17 >> As a further discrepancy, the user eclass requires >0 for the IDs,
18 >> whereas the checks in acct-user and acct-group is for >= 0.
19 >>
20 >> Would it be ok to suggest that we allow -1 (or 0, but that could be
21 >> confused with the root user/group) in acct-user and acct-group to
22 >> specify "no specific id, please allocate dynamically"?
23 >>
24 >> Use case: I'm building some experimental packages in an overlay, and I
25 >> really don't care what the UID and GID values are, I just need something
26 >> unique on the host I can use to avoid running the service as root.
27 >> Guessing I could just manually useradd -r but then again ... if I do
28 >> later submit these into the main tree (or other packages) then it
29 >> becomes a problem, and maintaining acct-{user,group}/* outside of main
30 >> tree could conflict with main tree at a later stage ... either way,
31 >> having some way to say "I honestly don't care, just give me a random
32 >> number" is probably a good thing.
33 >>
34 > I'll look into adding support for '-1' in a few days. However, I'm
35 > going to add QA checks to prevent it from getting into ::gentoo first.
36
37 Assuming I understand that correctly, you're happy with -1 values going
38 into overlays, but not into ::gentoo?
39
40 Would you mind to explain the motivation for that?
41
42 I'm also happy to take a whack at generating a patch series for you for
43 the eclasses themselves (not familiar with the QA check code yet),
44 including sorting out the >0 vs >=0 discrepancy, if you're happy with that?
45
46 Kind Regards,
47 Jaco

Replies

Subject Author
Re: [gentoo-dev] dynamic groups and users "Michał Górny" <mgorny@g.o>