1 |
On Wed, 2019-06-05 at 17:14 -0400, Michael Orlitzky wrote: |
2 |
> On 6/5/19 5:12 AM, Michał Górny wrote: |
3 |
> > + |
4 |
> > + # check for ACCT_USER_ID collisions early |
5 |
> > + if [[ -n ${ACCT_USER_ENFORCE_ID} ]]; then |
6 |
> > + local pwd=$(egetent passwd "${ACCT_USER_ID}") |
7 |
> > + if [[ -n ${pwd} ]]; then |
8 |
> > + eerror "The required UID is already taken by another user." |
9 |
> > + eerror " UID: ${ACCT_USER_ID} (needed for ${PN})" |
10 |
> > + eerror " current user: ${pwd}" |
11 |
> > + die "UID ${ACCT_USER_ID} taken already" |
12 |
> > + fi |
13 |
> > + fi |
14 |
> > +} |
15 |
> |
16 |
> If we set ACCT_USER_ENFORCE_ID=true in ftp-0.ebuild and then "emerge |
17 |
> acct-user/ftp" again, the second one dies with |
18 |
> |
19 |
> * The required UID is already taken by another user. |
20 |
> * UID: 21 (needed for ftp) |
21 |
> |
22 |
> This prevents "emerge -e @world" from working, and would prevent an |
23 |
> upgrade to ftp-1.ebuild in the future. |
24 |
> |
25 |
> We could augment the checks to ignore the existing user/group if its |
26 |
> name agrees with the one we're trying to create, but now I'm having deja |
27 |
> vu. I think this is another reason why I decided to go with a dummy file |
28 |
> installed under /var/lib to catch collisions: the PM will necessarily |
29 |
> ignore collisions from the same package. |
30 |
|
31 |
Good catch. Let's see what others have to say. |
32 |
|
33 |
If we're going to check for username patches, we'd need another |
34 |
user.eclass portability knob. |
35 |
|
36 |
-- |
37 |
Best regards, |
38 |
Michał Górny |