X-Recipient: archive-cygwin@delorie.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@cygwin.com
From: Andrew DeFaria <Andrew@DeFaria.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@mail.gmail.com> <4A89B06B.5070509@etr-usa.com>
Mime-Version:  1.0
Content-Type:  text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding:  7bit
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@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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

