GNU bug report logs - #36966
install-sh -s on 555 executable fails

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: automake; Reported by: Karl Berry <karl@HIDDEN>; dated Wed, 7 Aug 2019 21:52:01 UTC; Maintainer for automake is bug-automake@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Aug 2019 21:51:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 07 17:51:02 2019
Received: from localhost ([127.0.0.1]:39583 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hvTpl-0003XF-Pj
	for submit <at> debbugs.gnu.org; Wed, 07 Aug 2019 17:51:02 -0400
Received: from lists.gnu.org ([209.51.188.17]:45723)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <karl@HIDDEN>) id 1hvTpj-0003X7-LL
 for submit <at> debbugs.gnu.org; Wed, 07 Aug 2019 17:51:00 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45002)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <karl@HIDDEN>) id 1hvTpi-0007fu-E8
 for bug-automake@HIDDEN; Wed, 07 Aug 2019 17:50:59 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_20,RCVD_IN_DNSWL_MED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <karl@HIDDEN>) id 1hvTph-0000Zk-IZ
 for bug-automake@HIDDEN; Wed, 07 Aug 2019 17:50:58 -0400
Received: from freefriends.org ([96.88.95.60]:54726)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <karl@HIDDEN>)
 id 1hvTph-0000Xz-BC
 for bug-automake@HIDDEN; Wed, 07 Aug 2019 17:50:57 -0400
X-Envelope-From: karl@HIDDEN
X-Envelope-To: <bug-automake@HIDDEN>
Received: from freefriends.org (freefriends.org [96.88.95.60])
 by freefriends.org (8.14.7/8.14.7) with ESMTP id x77LosDu032555
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <bug-automake@HIDDEN>; Wed, 7 Aug 2019 15:50:54 -0600
Received: (from apache@localhost)
 by freefriends.org (8.14.7/8.14.7/Submit) id x77LorIF032554;
 Wed, 7 Aug 2019 15:50:53 -0600
Date: Wed, 7 Aug 2019 15:50:53 -0600
Message-Id: <201908072150.x77LorIF032554@HIDDEN>
From: Karl Berry <karl@HIDDEN>
To: bug-automake@HIDDEN
Subject: install-sh -s on 555 executable fails
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 96.88.95.60
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

(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.




Acknowledgement sent to Karl Berry <karl@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-automake@HIDDEN. Full text available.
Report forwarded to bug-automake@HIDDEN:
bug#36966; Package automake. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.