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: Ralf Wildenhues
Subject: Re: libtool-1.5.18 -- installed files owned by non-root user
Date: Wed, 6 Jul 2005 05:22:14 +0200
User-agent: Mutt/1.5.9i

Hi Peter,

* 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).

:-/

> With GNU tar one could of course use either
>       tar cf - --owner=0 --group=0
> or
>       tar xf --no-same-owner
> but that will fail for other tar implementations.

Yep.

> >>    [ `id -u` == 0 ] && chown -R root: $prefix/share/$pkg

(BTW, `==' is not portable test syntax, but `=' is equivalent.)

> >Why not
> >  chown -R `id -u`:`id -g` $prefix/share/$pkg
> >here, unconditionally?  ......
> 
> Well, I either install as me (owning everything to be installed) or as root;
> thus the simple procedure above is good enough for me. Moreover whenever I
> create files as non-root, these files are owned automatically by me (at
> least on our linux systems).

Yep, and I believe that assumption is pretty safe nowadays.
However, `id' is not listed as allowed tool in standards..

> >.......  Are there systems where chown does not
> >understand the uid:gid syntax?
> 
> Certainly no posix compliant ones, but then if there were no others much of
> Autoconf&Co would be superfluous.

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.

Also, SUSv3 speaks of old systems where chown of uid only would fail if
the target user does not belong to the group owner.  OTOH, I'm not sure
the user:group syntax is all that portable.  I believe the former issue
is less of a problem today.  Oh well.

The goal is still to put the time-preserving functionality into
`install-sh', but even if a patch gets accepted into Automake now, we
need to wait with the corresponding libtool change, so might as well put
this hack in now.

Regards,
Ralf




reply via email to

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