emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#36966: closed (install-sh -s on 555 executable fails)


From: GNU bug Tracking System
Subject: bug#36966: closed (install-sh -s on 555 executable fails)
Date: Sun, 22 Nov 2020 02:10:03 +0000

Your message dated Sat, 21 Nov 2020 19:08:57 -0700
with message-id <202011220208.0AM28vmC003722@freefriends.org>
and subject line Re: bug#36966: install-sh -s on 555 executable fails
has caused the debbugs.gnu.org bug report #36966,
regarding install-sh -s on 555 executable fails
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
36966: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36966
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: install-sh -s on 555 executable fails Date: Wed, 7 Aug 2019 15:50:53 -0600
(I'm not on this list, so please keep me in cc if need be.)

It seems that install-sh -s (what automake's install-strip target can
end up doing) fails if the original file doesn't have the owner-write
bit set:

cp /bin/cp /tmp/rx            # any binary will do
chmod 555 /tmp/rx             # make unwritable to owner
install-sh -s /tmp/rx /tmp/sx # try to install, with strip
-> strip: unable to copy file '/tmp/_inst.31092_'; reason: Permission denied
echo $?
-> 1

Although install-sh (version 2018-03-11.20, lines 224ff.) does some
stuff to ensure that umask will not clear an owner-writable bit in the
destination, that's not enough to make it owner-writable if it's not
already.

The only less-than-wonderful fix I could come up with is to explicitly
do chmod u+w if strip is being executed. I thought maybe it would be
worth trying the strip even if the chmod failed, hence the ; instead of
&&, but it's not something I feel strongly about. And maybe there is
some nicer way to do it altogether.

--- a/build-aux/install-sh
+++ b/build-aux/install-sh
@@ -461,7 +461,7 @@ do
     #
     { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
     { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
-    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || ($doit $chmodcmd u+w "$dsttmp"; $doit $stripcmd 
"$dsttmp") } &&
     { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
 
     # If -C, don't bother to copy if it wouldn't change the file.


Wdyt? --thanks, karl.



--- End Message ---
--- Begin Message --- Subject: Re: bug#36966: install-sh -s on 555 executable fails Date: Sat, 21 Nov 2020 19:08:57 -0700
    chmod 555 /tmp/rx             # make unwritable to owner
    install-sh -s /tmp/rx /tmp/sx # try to install, with strip
    -> strip: unable to copy file '/tmp/_inst.31092_'; reason: Permission denied

Paul fixed this install-sh bug that I reported last August (commit of
2019-08-26). Closing.


--- End Message ---

reply via email to

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