Gentoo Archives: gentoo-alt

From: velociraptor <velociraptor@×××××.com>
To: gentoo-alt@l.g.o
Subject: [gentoo-alt] eutils.eclass useradd/groupadd using incorrect flags for Solaris prefix
Date: Wed, 08 Sep 2010 15:22:39
Message-Id: AANLkTi=0Nbsf1n_=VNCi2szbQkMptQ0=xoPMPM_F8kSY@mail.gmail.com
1 I ran into this while building nginx-0.8.49 (built fine, but had to
2 fetch dev-libs/geoip-1.4.6 by hand and then run eapify, as the fetch
3 urls for tinderbox are broken; didn't investigate that further).
4
5 In my utils.eclass version: # $Header:
6 /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.348 2010/07/11
7 17:29:10 betelgeuse Exp $
8
9 groupadd for ~x86-solaris fell through to groupadd -r which isn't an
10 option on Solaris. Likewise, useradd is falling through the cases to
11 *, which uses useradd -r, also not valid on Solaris. I thought this
12 had been fixed earlier, as I recall reporting the useradd issue when I
13 first tried to bootstrap prefix under Solaris.
14
15 I fixed with the following patch:
16
17 --- orig.eutils.eclass 2010-09-08 08:07:32.083592361 -0700
18 +++ eutils.eclass 2010-09-08 08:07:58.191086901 -0700
19 @@ -711,7 +711,7 @@
20 fi
21 ;;
22
23 - *-openbsd*)
24 + *-openbsd*|*-solaris*)
25 if [[ -z $@ ]] ; then
26 useradd -u ${euid} -s ${eshell} \
27 -d ${ehome} -c "Added by portage for ${PN}" \
28 @@ -851,7 +851,7 @@
29 pw groupadd ${egroup} -g ${egid} || die "enewgroup failed"
30 ;;
31
32 - *-netbsd*)
33 + *-netbsd*|*-solaris*)
34 case ${egid} in
35 *[!0-9]*) # Non numeric
36 for ((egid = 101; egid <= 999; egid++)); do
37
38 My eutils.eclass isn't the latest, though, so I doubt that will apply
39 cleanly. I also haven't tested extensively, but worked fine for
40 uid/gid 101 and /bin/false home dir. Kind of ironic that we still see
41 BSD-isms in a SysV derived OS.
42
43 Regards--
44 =Nadine=