bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libtool-1.5.18 -- installed files owned by non-root user


From: Peter Breitenlohner
Subject: Re: libtool-1.5.18 -- installed files owned by non-root user
Date: Wed, 6 Jul 2005 09:34:24 +0200 (CEST)

On Wed, 6 Jul 2005, Ralf Wildenhues wrote:

* Peter Breitenlohner wrote on Fri, Jul 01, 2005 at 05:35:06PM CEST:
On Fri, 1 Jul 2005, Ralf Wildenhues wrote:
Incidentally, that kind of "dancing around" is in no way unique to
libtool.

I just checked that both emacs-21.4 and xemacs-21.4.17 do something like
        (cd ${src} && tar cf -) | (cd ${dst} && umask 022 & tar xf -)
which preserves the timestamps and unfortunately ownership as well. If I
remember correctly there are a few other packages doing either the same
thing or "cp -p" (or similar).

:-/

Hi Ralf,

another package that needs some of its files chowned to root is gcc!! (at
least 3.4.x) -- for reasons not related to timestamps.

Oh well.  Let's try to play safe here.   Would something like
       if test "`id -u`" != 0; then :; else \
         chown -R root $(DESTDIR)$(ltdldatadir) && \
         chgrp -R root $(DESTDIR)$(ltdldatadir) || exit 1; \
       fi

be ok?  (Rationale: if `id' does not work, we try to chown/chgrp anyway.

The above doesn't work. If `id' fails it most probably won't yield "0"
and the chown/chgrp will be skipped.

The design goal should be that if `make install' is done by

(1) root, then all installed files SHOULD be (on posix systems MUST be)
owned by root.

(2) non-root (e.g. a staged install aka package building), a failing "chown"
or "chgrp" MUST NOT cause make to terminate with an error.

What about simply
        chown -R root $(DESTDIR)$(ltdldatadir) && \
        chgrp -R root $(DESTDIR)$(ltdldatadir) || :
where failure of chown/chgrp is ignored? Who cares about some noise when
`make install' is done by non-root or on non-posix systems, in particular
when the cause of such noise can easily be deduced.

BTW: There might actually be some privilege granting mechanism's that allow
a non-root user to successfully chown/chgrp files.

Regards
Peter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]