Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 506410 - user.eclass - enewgroup/user should create new group/user in $ROOT
Summary: user.eclass - enewgroup/user should create new group/user in $ROOT
Status: RESOLVED DUPLICATE of bug 53269
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-01 06:33 UTC by Vieri
Modified: 2014-04-01 16:25 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vieri 2014-04-01 06:33:06 UTC
cups init script contains:
        checkpath -q -d -m 0775 -o root:lp /var/cache/cups
        checkpath -q -d -m 0775 -o root:lp /var/cache/cups/rss
        checkpath -q -d -m 0755 -o root:lp /run/cups
        checkpath -q -d -m 0511 -o lp:lpadmin /run/cups/certs

and it fails to start with the follwoing error message:

owner 'lp:lpadmin' not found

/usr/portage/net-print/cups/cups-1.7.1.ebuild contains:

pkg_setup() {
        enewgroup lp
        enewuser lp -1 -1 -1 lp
        enewgroup lpadmin 106

# ROOT=/target emerge -avD cups

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] net-print/cups-1.7.1 to /target/ USE="ssl threads -X -acl -dbus -debug -gnutls -java -kerberos -lprng-compat -pam -python (-selinux) -static-libs -usb -xinetd -zeroconf" LINGUAS="ca es fr it ja ru" PYTHON_SINGLE_TARGET="python2_7 -python2_6" PYTHON_TARGETS="python2_7 -python2_6" 0 kB

./configure --prefix=/usr --build=i486-pc-linux-gnu --host=i486-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib --localstatedir=/var --with-rundir=/run/cups --with-cups-user=lp --with-cups-group=lp --with-docdir=/usr/share/cups/html --with-languages=ru fr ca it es ja --with-system-groups=lpadmin --disable-acl --disable-avahi --disable-dbus --disable-debug --disable-debug-guards --disable-gssapi --disable-pam --disable-static --enable-threads --disable-libusb --disable-dnssd --without-java --without-perl --without-php --without-python --without-xinetd --enable-libpaper --with-systemdsystemunitdir=/usr/lib/systemd/system --disable-gnutls --enable-openssl

 # grep lp /target/etc/group
lp:x:7:lp

On the other hand:
# grep lp /etc/group
lp:x:7:lp
lpadmin:x:106:

Does anyone know why this happens?

I'm supposing it's a bug.
Comment 1 Vieri 2014-04-01 06:57:33 UTC
/usr/portage/eclass/user.eclass doesn0t seem to handle the case when a ROOT variable is defined and using getent and groupadd will read/write to the parent system, not the "ROOT target".

        # see if group already exists
        if [[ -n $(egetent group "${egroup}") ]] ; then
                return 0
        fi
        einfo "Adding group '${egroup}' to your system ..."

[...]

        *)
                # ignore output if nscd doesn't exist, or we're not running as root
                nscd -i "${db}" 2>/dev/null
                getent "${db}" "${key}"
                ;;
Comment 2 SpanKY gentoo-dev 2014-04-01 16:25:59 UTC

*** This bug has been marked as a duplicate of bug 53269 ***