delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/18/00:43:05

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_21,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Andrew DeFaria <Andrew AT DeFaria DOT com>
Subject: Re: UNZIP: Why don't .exe/.dll files get eXecute privs?
Date: Mon, 17 Aug 2009 21:42:16 -0700
Lines: 46
Message-ID: <h6dbf9$qtt$1@ger.gmane.org>
References: <806a89db0908151400j6ec51bb8o6622b9da87c23bd7 AT mail DOT gmail DOT com> <4A89B06B DOT 5070509 AT etr-usa DOT com>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.1) Gecko/20090715 Lightning/1.0pre Thunderbird/3.0b3
In-Reply-To: <4A89B06B.5070509@etr-usa.com>
X-Stationery: 0.4.10
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 08/17/2009 12:32 PM, Warren Young wrote:
> 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?
Sure, why not?
> 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?
Computers are good at handling large lists of things...
>
> Now throw in shebang magic.  Does unzip have to set the executable bit 
> on files with a shebang line at the start?
Great idea!
> What if it's binary data that just happens to start with those two bytes?
You obviously need to look at more than just those two...
> Now does unzip have to parse the line and check for the existence of 
> an interpreter?
Another good idea!
> 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.
Only 1/2 a smiley smirk...
-- 
Andrew DeFaria <http://defaria.com>
What happened to Preparations A through G?


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019