Gentoo Archives: gentoo-dev

From: splite-gentoo@××××××××××××××××.edu
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] EID database and entries getting to baselayout
Date: Thu, 29 Jan 2004 20:35:47
Message-Id: 20040129202530.GD7186@sigint.cs.purdue.edu
In Reply to: Re: [gentoo-dev] EID database and entries getting to baselayout by Chris Gianelloni
1 On Thu, Jan 29, 2004 at 02:01:07PM -0500, Chris Gianelloni wrote:
2 > ...or you could simply replace the default eid.passwd file with one in
3 > your /etc/portage directory to reflect your company's "proper" UID/GID
4 > usage.
5
6 No, that's not the same thing. I would have to pre-create all the
7 accounts in eid.passwd in the global database, otherwise enew{user,group}
8 would just add them to the local passwd and group files as before. I don't
9 really want to pollute my database with many account entries I will never
10 use.
11
12 > It makes much more sense to have portage conform to your system
13 > in this way than to take the time/energy to create yet another almost
14 > unused feature.
15
16 Surely I'm not the only one in the world sharing account info among
17 different Unixes? Sure, I wish my predecessors had left more room at
18 the beginning of the uid space for system accounts, but back in the day,
19 they didn't need that many system accounts and uid space was tight
20 (remember signed 16-bit uids?)
21
22 If Gentoo has any designs on the enterprise space, I think such a feature
23 would be well-received.
24
25 > I don't mean to say this to insult at all.
26
27 No insult taken; we're just discussing. Calling me an XP user would be
28 an insult.
29
30 > I just
31 > think the better method for anything of this type is to have a default
32 > that portage uses, which works for the masses,
33
34 I'm not suggesting turning my requested feature on by default.
35
36 > but can be overridden by
37 > files in /etc/portage (such as package.mask, package.unmask). It makes
38 > for a cleaner approach IMHO.
39
40 I'm not sure have having a feature in FEATURE is less "clean" than having
41 it in /etc/portage. We could turn each FEATURE keyword into a file in, say,
42 PORTDIR/feature (ala /etc/config under IRIX) and allow people to override
43 them with yet more files in /etc/portage, but I don't see how that would be
44 more clean.
45
46 As for time/energy, I've spent more time typing these emails that it took
47 to patch eutils.eclass. (Granted, I'm much faster at writing shell scripts
48 than prose.) I haven't tested this yet, but it shows the general idea.
49
50 diff -u eutils.eclass /tmp/eutils.eclass
51 --- eutils.eclass 2004-01-13 01:44:07.000000000 -0500
52 +++ /tmp/eutils.eclass 2004-01-29 15:00:16.000000000 -0500
53 @@ -583,14 +583,18 @@
54 export SANDBOX_ON="0"
55 if [ -z "${eextra}" ]
56 then
57 - useradd ${opts} ${euser} \
58 - -c "added by portage for ${PN}" \
59 - || die "enewuser failed"
60 + eextra="-c 'added by portage for ${PN}'"
61 else
62 einfo " - Extra: ${eextra}"
63 - useradd ${opts} ${euser} ${eextra} \
64 - || die "enewuser failed"
65 fi
66 + if use nonewusers $FEATURES; then
67 + eerror "Run the following command:"
68 + eerror " useradd ${opts} ${euser} ${eextra}"
69 + eerror "then rerun emerge"
70 + die "enewuser failed: user ${euser} does not exist"
71 + fi
72 + useradd ${opts} ${euser} ${eextra} || die "enewuser failed"
73 +
74 export SANDBOX_ON="${oldsandbox}"
75
76 if [ ! -e "${ehome}" ] && [ ! -e "${D}/${ehome}" ]
77 @@ -658,6 +662,12 @@
78 # add the group
79 local oldsandbox="${SANDBOX_ON}"
80 export SANDBOX_ON="0"
81 + if use nonewusers $FEATURES; then
82 + eerror "Run the following command:"
83 + eerror " groupadd ${opts} ${egroup}"
84 + eerror "then rerun emerge"
85 + die "enewgroup failed: group ${egroup} does not exist"
86 + fi
87 groupadd ${opts} ${egroup} || die "enewgroup failed"
88 export SANDBOX_ON="${oldsandbox}"
89 }
90
91 --
92 gentoo-dev@g.o mailing list