X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_21 X-Spam-Check-By: sourceware.org Message-ID: <4A89B06B.5070509@etr-usa.com> Date: Mon, 17 Aug 2009 13:32:59 -0600 From: Warren Young User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Cygwin-L Subject: Re: UNZIP: Why don't .exe/.dll files get eXecute privs? References: <806a89db0908151400j6ec51bb8o6622b9da87c23bd7 AT mail DOT gmail DOT com> In-Reply-To: <806a89db0908151400j6ec51bb8o6622b9da87c23bd7@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Jim Reisert AD1C wrote: > > I can't control how the ZIP file gets created, but I do expect that > when I unzip a file, that the .exe will actually execute without > having to change permissions! I guess it comes down to a question of whether *.exe implies chmod +x. It doesn't in any "native" *ix packaging format, like tar or cpio. Doing this would thus be a break from expected behavior for some. I can see your point, Jim, but I don't think the answer is obvious. Should unzip do this for *.sh? *.pl? *.insert-yfl-extension? Before you answer, have you looked at a programming language list lately? There are "only" about 750 on this index page in Wikipedia: http://en.wikipedia.org/wiki/List_of_programming_languages I've seen other lists that put the count at more like 2,500. Obviously we don't have to handle them all, as some may re-use extensions, and others aren't directly executable from a shell, like C code. We're still left with hundreds, surely? If we don't have to handle them all, what's the razor that describes which get this special treatment and which don't? How do you deal with conflicts among file name extensions? Now throw in shebang magic. Does unzip have to set the executable bit on files with a shebang line at the start? What if it's binary data that just happens to start with those two bytes? Now does unzip have to parse the line and check for the existence of an interpreter? Should unzip have this special-case code only if it doesn't see an ACL, or does it override explicit settings? This isn't Cygwin-specific. I use a package on Linux that uses zip for its distributed binary packages (yeah, yech, I know), and has a bunch of chmod hackery in its post-unpack installation instructions. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple