Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] dynamic groups and users
Date: Thu, 01 Aug 2019 20:01:55
Message-Id: CAJ0EP43fKHrGCzQWdGZ-UM-=DjhTxzKYhodeug2P=PLfCw3RFA@mail.gmail.com
In Reply to: [gentoo-dev] dynamic groups and users by Jaco Kroon
1 On Thu, Aug 1, 2019 at 3:04 PM Jaco Kroon <jaco@××××××.za> wrote:
2 >
3 > Hi,
4 >
5 > Looking at the new eclasses for acct-user and acct-group.
6 >
7 > These enforce that a group and user id should be set.
8 >
9 > This is not a requirement for enewuser nor enewgroup.
10
11 The new eclasses require you to set a fixed id, but they do not
12 enforce that the id is available by default. If the id is taken
13 already, it will allocate a new one.
14
15 User/group 0 is pretty much guaranteed to always exist, so you could
16 set ACCT_{GROUP,USER}_ID=0 to trigger the desired behavior.
17
18 If you're feeling crazy, this will get you a random assignment between
19 1 and 999, with the same fallback logic.
20
21 ACCT_GROUP_ID=$(( RANDOM % 998 + 1 ))

Replies

Subject Author
Re: [gentoo-dev] dynamic groups and users Jaco Kroon <jaco@××××××.za>
Re: [gentoo-dev] dynamic groups and users Mike Gilbert <floppym@g.o>