Gentoo Archives: gentoo-dev

From: Brian Dolbec <dolsen@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] Should the compressed archive of an executable file be executable too?
Date: Sun, 18 Jun 2017 17:16:23
Message-Id: 20170618101613.6d88058a.dolsen@gentoo.org
In Reply to: [gentoo-dev] [RFC] Should the compressed archive of an executable file be executable too? by Jonas Stein
On Sun, 18 Jun 2017 13:41:17 +0200
Jonas Stein <jstein@g.o> 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 <dolsen>