From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7657D139694 for ; Sun, 18 Jun 2017 17:16:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0D0E1E0BE9; Sun, 18 Jun 2017 17:16:16 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B8C8CE0BCB for ; Sun, 18 Jun 2017 17:16:15 +0000 (UTC) Received: from professor-x (d108-172-194-175.bchsia.telus.net [108.172.194.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id 62D1C3417EC for ; Sun, 18 Jun 2017 17:16:14 +0000 (UTC) Date: Sun, 18 Jun 2017 10:16:13 -0700 From: Brian Dolbec To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [RFC] Should the compressed archive of an executable file be executable too? Message-ID: <20170618101613.6d88058a.dolsen@gentoo.org> In-Reply-To: References: Organization: Gentoo Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: 539d48fd-9005-4130-abf6-0d7e916a96c0 X-Archives-Hash: 7a800547ec61ebbb4d197464a784737e On Sun, 18 Jun 2017 13:41:17 +0200 Jonas Stein wrote: > Dear all, > > if we compress an executable script > hello.sh > with bzip2 or gzip the result is a file > hello.sh.bz2 or hello.sh.gz > with executable permissions. However it is not executable, of course. > > ./hello.sh.bz2 > "cannot execute binary file: Exec format error" > > One can not blame bzip2 for it, because it is exactly what its man > page writes: > "Each compressed file has the same modification date, permissions, > and, when possible, ownership as the corresponding original, so that > these properties can be correctly restored at decompression time." > > On gentoo systems we can find many archives with with executable bit > by running > > $ find /usr/share/doc/ -executable -type f > > > * Is it proper to install compressed archives (.zip, .gz, .bz2) > with executable permissions? > > * Should we compress executable files at all? > (Example scripts are usually very small.) > > * Should we remove the executable permission of example scripts > anyway, because the user should not execute it directly, but > rather see it as example? The user reads it, copies and modifies > it and then sets the +x. > > > I am interested in your comments and wish you a nice Sunday. > yeah, makes sense to drop +x, it is better to look at the examples before running them blindly. -- Brian Dolbec