From unknown Sat Aug 16 18:38:35 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#36966 <36966@debbugs.gnu.org> To: bug#36966 <36966@debbugs.gnu.org> Subject: Status: install-sh -s on 555 executable fails Reply-To: bug#36966 <36966@debbugs.gnu.org> Date: Sun, 17 Aug 2025 01:38:35 +0000 retitle 36966 install-sh -s on 555 executable fails reassign 36966 automake submitter 36966 Karl Berry severity 36966 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 07 17:51:02 2019 Received: (at submit) by debbugs.gnu.org; 7 Aug 2019 21:51:02 +0000 Received: from localhost ([127.0.0.1]:39583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hvTpl-0003XF-Pj for submit@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 ) id 1hvTpj-0003X7-LL for submit@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 ) id 1hvTpi-0007fu-E8 for bug-automake@gnu.org; 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 ) id 1hvTph-0000Zk-IZ for bug-automake@gnu.org; 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 ) id 1hvTph-0000Xz-BC for bug-automake@gnu.org; Wed, 07 Aug 2019 17:50:57 -0400 X-Envelope-From: karl@freefriends.org X-Envelope-To: 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 ; 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@freefriends.org> From: Karl Berry To: bug-automake@gnu.org 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 21 21:09:01 2020 Received: (at 36966) by debbugs.gnu.org; 22 Nov 2020 02:09:01 +0000 Received: from localhost ([127.0.0.1]:46708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgeoH-0000FB-4r for submit@debbugs.gnu.org; Sat, 21 Nov 2020 21:09:01 -0500 Received: from freefriends.org ([96.88.95.60]:33356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgeoF-0000Em-Ro; Sat, 21 Nov 2020 21:09:00 -0500 X-Envelope-From: karl@freefriends.org Received: from freefriends.org (freefriends.org [96.88.95.60]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 0AM28vCN003723 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 21 Nov 2020 19:08:58 -0700 Received: (from apache@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 0AM28vmC003722; Sat, 21 Nov 2020 19:08:57 -0700 Date: Sat, 21 Nov 2020 19:08:57 -0700 Message-Id: <202011220208.0AM28vmC003722@freefriends.org> From: Karl Berry To: 36966@debbugs.gnu.org Subject: Re: bug#36966: install-sh -s on 555 executable fails In-Reply-To: <201908072150.x77LorIF032554@freefriends.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36966 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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. From unknown Sat Aug 16 18:38:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 20 Dec 2020 12:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator