Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 24178

Summary: gdbm files installed as bin:bin instead of root:root
Product: Gentoo Linux Reporter: splite <splite-gentoo>
Component: [OLD] LibraryAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: dc1847, ppc-macos
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: gdbm-1.8.3-r1.ebuild patch which uses suggested fix

Description splite 2003-07-09 07:55:15 UTC
gdbm installs its files with bin:bin ownership instead of root:root.  Here's an
ebuild patch:

diff -u gdbm-1.8.0-r5.ebuild.orig gdbm-1.8.0-r5.ebuild
--- gdbm-1.8.0-r5.ebuild.orig   2003-06-22 01:21:43.000000000 -0500
+++ gdbm-1.8.0-r5.ebuild        2003-07-09 09:49:27.000000000 -0500
@@ -41,12 +41,12 @@
 }
 
 src_install() {
-       make prefix=${D}/usr \
+       make BINOWN=root BINGRP=root prefix=${D}/usr \
                man3dir=${D}/usr/share/man/man3 \
                infodir=${D}/usr/share/info \
                install || die
 
-       make includedir=${D}/usr/include/gdbm \
+       make BINOWN=root BINGRP=root includedir=${D}/usr/include/gdbm \
                install-compat || die
 
        dosed "s:/usr/local/lib':/usr/lib':g" /usr/lib/libgdbm.la


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Guy Martin (RETIRED) gentoo-dev 2003-11-13 15:07:13 UTC
Wonder why this was assigned to me.
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2004-04-22 11:24:18 UTC
what's the problem when ownership is wrong ?
Comment 3 Martin Holzer (RETIRED) gentoo-dev 2004-04-22 11:24:59 UTC
finally fixed, since econf and emake are used now
Comment 4 splite 2005-09-20 20:06:51 UTC
The problem when the ownership is wrong is that it's bad form to install files
that aren't owned by root in system directories.  There's no reason gdbm's files
need to be owned by bin:bin.  In fact, this later caused bug #96743 because Mac
OS X doesn't have user/group bin.

And no, using econf and emake doesn't fix the problem.  BINOWN and BINGRP are
hardcoded to "bin" in Makefile.in and aren't affected by configure.
Comment 5 SpanKY gentoo-dev 2005-09-21 05:43:11 UTC
*** Bug 96743 has been marked as a duplicate of this bug. ***
Comment 6 Fabian Groffen gentoo-dev 2005-09-21 10:27:44 UTC
Created attachment 68944 [details, diff]
gdbm-1.8.3-r1.ebuild patch which uses suggested fix

on OSX the group of root is wheel, so we cannot hardcode root:root here.  I
attached a patch where I revert the OSX specific bin user/group creation and
use the suggested BINOWN and BINGRP variables to set the root user and it's
primary group via a call to `id -gn root`.

I'm not sure on whether this is the right way to do it, but it appears to work
on OSX and linux.
Comment 7 Fabian Groffen gentoo-dev 2005-09-21 10:40:20 UTC
thinking this over, we could just use uid=0 and gid=0 instead of trying with
names and avoid the `id -gn root` call.  However, if portage ever will allow
non-root installs, then it would require here to use `id -u` and `id -g` for
user and group respectively.
Comment 8 splite 2005-09-21 13:24:46 UTC
Hoist on my own petard. :)  Should have used 0 instead of root, sorry about
that.  (In my defense, it _is_ an old patch and predates the "which group is gid
0?" saga.)  As for non-root installs, I'd be tempted to just rip out the
Makefile bits that set the ownership and send the patch upstream.  There's just
no need for gdbm to set the file ownership at all, IMO.
Comment 9 SpanKY gentoo-dev 2005-09-21 16:15:06 UTC
fixed in cvs