Gentoo Archives: gentoo-dev

From: Rich Freeman <rich0@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Requirements for UID/GID management
Date: Sun, 29 Jan 2017 02:23:06
Message-Id: CAGfcS_nVnb-USUruY3u7OfbkiBqKg=uPrHBZkRzFc4jmeA6k_Q@mail.gmail.com
In Reply to: Re: [gentoo-dev] Requirements for UID/GID management by Michael Orlitzky
1 On Sat, Jan 28, 2017 at 8:56 PM, Michael Orlitzky <mjo@g.o> wrote:
2 > On 01/27/2017 11:21 PM, Rich Freeman wrote:
3 >>
4 >> It isn't like inconsistent UIDs are the end of the world. However,
5 >> IMO it still makes sense to at least try to standardize such things.
6 >> Really, if you have a package always installing the same user simply
7 >> sticking a default UID without any effort to avoid collisions is
8 >> better than nothing, but having a wiki page where people can register
9 >> UIDs isn't that big a deal.
10 >>
11 >
12 > Here's a problem I have no solution for. Suppose we tell everyone to
13 > pick a fixed UID for their user packages. I have a randomly assigned
14 > "tcpdump" user as UID 102 on my machine today. If we roll this out next
15 > week and the tcpdump maintainer chooses UID=321 as his fixed UID, what
16 > happens when I go to install sys-user/tcpdump? Every option is bad:
17 >
18 > * Keep the existing user. Now its UID is wrong. You might say "so
19 > what," but the majority of users on the majority of systems are
20 > going to have this problem, so you have to wonder what we've
21 > gained by deciding on fixed UIDs and then ultimately assigning
22 > them randomly anyway.
23
24 Honestly, I really will say "so what" here. :)
25
26 Sure, it isn't a perfect solution, but it costs you nothing, and the
27 fallback is just random UIDs, which as we've already established
28 aren't a huge problem. For new installs things will be more
29 consistent.
30
31 It is of course possible to remap UIDs, but I don't think we should
32 ever try to do this automatically, because only the user can know if
33 every filesystem that might contain the old UIDs is actually mounted,
34 or if they mind find killing their drives at the moment, or if
35 anything important is running under the old uid.
36
37 I'm sure somebody will end up offering up a script at some point that
38 will remap an existing Gentoo install in single user mode to the new
39 defaults if somebody wishes to do so.
40
41 The bottom line is that I think at least picking some defaults is
42 going to result in a typical new install having matching uids, which
43 is going to make life easier for small-scale multi-host setups (NFS,
44 containers, etc). No, it will never work at the enterprise scale (for
45 starters, other distros will probably come into play), and it doesn't
46 matter for a standalone box. However, just putting a stick in the mud
47 will give 95% of the benefit for zero additional work. And the
48 fallback to random IDs is already implemented anyway.
49
50 So, don't try to fix the decades-old boxes. By now everybody who has
51 them has beards gray enough to deal with any issues, and they'll have
52 to have been dealing with them all along anyway.
53
54 --
55 Rich

Replies

Subject Author
Re: [gentoo-dev] Requirements for UID/GID management Michael Orlitzky <mjo@g.o>
Re: [gentoo-dev] Requirements for UID/GID management Michael Orlitzky <mjo@g.o>