Re: UNZIP: Why don't .exe/.dll files get eXecute privs?

2009-08-17 Thread Warren Young

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



Re: UNZIP: Why don't .exe/.dll files get eXecute privs?

2009-08-17 Thread Andrew DeFaria

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



Re: UNZIP: Why don't .exe/.dll files get eXecute privs?

2009-08-15 Thread Corinna Vinschen
On Aug 15 00:39, Charles Wilson wrote:
 Andrew DeFaria wrote:
 
  Why would DLLs need execute?
 
 because otherwise windows will refuse to load them, and the application
 you just launched which needs that DLL will fail with an ugly message
 about Failed to initialize: 0xc005.

0xc022, STATUS_ACCESS_DENIED.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

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



Re: UNZIP: Why don't .exe/.dll files get eXecute privs?

2009-08-15 Thread Dave Korn
Jim Reisert AD1C wrote:
 Here's an example:
 
 CYGWIN:
 
 
 c:\test\cygwin\bin\unzip \dx4w801\dx4win_regexp.zip
 Archive:  \dx4w801\dx4win_regexp.zip
   inflating: pcre3.dll
   inflating: regexp/freq1.txt
   inflating: regexp/qth1.txt
   inflating: Dx4win.exe
 
 c:\testls -l
 total 3296
 -rw-r--r-- 1 reisert Domain Users 3229184 Aug 14 00:20 Dx4win.exe
 -rw-r--r-- 1 reisert Domain Users  140288 Mar 17  2007 pcre3.dll
 drwxr-xr-x 1 reisert Domain Users   0 Aug 14 10:57 regexp
 
 
 GNUWIN32:
 
 c:\testunzip \dx4w801\dx4win_regexp.zip
 Archive:  /dx4w801/dx4win_regexp.zip
   inflating: pcre3.dll
   inflating: regexp/freq1.txt
   inflating: regexp/qth1.txt
   inflating: Dx4win.exe
 
 c:\testls -l
 total 3296
 -rwx--+ 1 reisert Domain Users 3229184 Aug 14 00:20 Dx4win.exe
 -rwx--+ 1 reisert Domain Users  140288 Mar 17  2007 pcre3.dll
 drwx--+ 1 reisert Domain Users   0 Aug 14 10:58 regexp

  So, which version of zip did you use to create the archive in the first
place?  It looks like what's going on here is that Gnuwin and Cygwin have
different notions on how to represent the permissions on a windows file in a
zip archive.  Gnuwin is storing the full windows ACL - note the '+' at the end
of the file perms when you unpack using that unzip.  Cygwin's zip presumably
stores and expects to find perms in the unix rwx format, and is maybe picking
some default perms when it doesn't find any unixy ones.  Potentially Cygwin's
zip could be extended to understand the windows ACL format and unpack it, but
for now I guess you need to make sure you pack and unpack with a matching pair
of zip/unzip, or accept that in the unixy cygwin world, a bunch of files from
a windows zip archive simply aren't going to come with unixy perms because
windows zip doesn't know about them.

cheers,
  DaveK



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



Re: UNZIP: Why don't .exe/.dll files get eXecute privs?

2009-08-15 Thread Jim Reisert AD1C
Dave Korn asked:

 So, which version of zip did you use to create the archive in the first place?

I got the ZIP file from someone else.  I don't know what program he
used, could have been WINZIP or something else.

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!

- Jim

-- 
Jim Reisert AD1C, jjreis...@alum.mit.edu, http://www.ad1c.us

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



UNZIP: Why don't .exe/.dll files get eXecute privs?

2009-08-14 Thread Jim Reisert AD1C
Something has been bugging me about Cygwin UNZIP for years.  When I
unzip a file, the extracted .exe and .dll files no longer have execute
privs. I have to manually chmod +x them.  This always occurs when I'm
in a DOS prompt and using the Cygwin unzip.

The same unzip from http://gnuwin32.sourceforge.net doesn't have this problem.

Why is Cygwin different?

Thanks - Jim

-- 
Jim Reisert AD1C, jjreis...@alum.mit.edu, http://www.ad1c.us

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



Re: UNZIP: Why don't .exe/.dll files get eXecute privs?

2009-08-14 Thread Dave Korn
Jim Reisert AD1C wrote:
 Something has been bugging me about Cygwin UNZIP for years.  When I
 unzip a file, the extracted .exe and .dll files no longer have execute
 privs. I have to manually chmod +x them.  This always occurs when I'm
 in a DOS prompt and using the Cygwin unzip.
 
 The same unzip from http://gnuwin32.sourceforge.net doesn't have this problem.
 
 Why is Cygwin different?

  It's not:

 ad...@ubik /tmp/unzip
 $ cp /bin/ls.exe  .
 
 ad...@ubik /tmp/unzip
 $ ls -la
 total 216
 drwxr-xr-x 1 DKAdmin None  0 Aug 14 17:59 .
 drwxrwxrwt 1 DKAdmin None  90112 Aug 14 17:58 ..
 -rwxr-xr-x 1 DKAdmin None 129536 Aug 14 17:59 ls.exe
 
 ad...@ubik /tmp/unzip
 $ zip -m test.zip ls.exe
   adding: ls.exe (deflated 51%)
 
 ad...@ubik /tmp/unzip
 $ unzip -tvv test.zip
 Archive:  test.zip
 testing: ls.exe   OK
 No errors detected in compressed data of test.zip.
 
 ad...@ubik /tmp/unzip
 $ ls -la
 total 152
 drwxr-xr-x 1 DKAdmin None 0 Aug 14 18:00 .
 drwxrwxrwt 1 DKAdmin None 90112 Aug 14 17:58 ..
 -rw-r--r-- 1 DKAdmin None 63625 Aug 14 18:00 test.zip
 
 ad...@ubik /tmp/unzip
 $ unzip test.zip
 Archive:  test.zip
   inflating: ls.exe
 
 ad...@ubik /tmp/unzip
 $ ls -la
 total 280
 drwxr-xr-x 1 DKAdmin None  0 Aug 14 18:00 .
 drwxrwxrwt 1 DKAdmin None  90112 Aug 14 17:58 ..
 -rwxr-xr-x 1 DKAdmin None 129536 Aug 14 17:59 ls.exe
 -rw-r--r-- 1 DKAdmin None  63625 Aug 14 18:00 test.zip
 
 ad...@ubik /tmp/unzip
 $

  Can you show an example?

cheers,
  DaveK

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



Re: UNZIP: Why don't .exe/.dll files get eXecute privs?

2009-08-14 Thread Jim Reisert AD1C
Here's an example:

CYGWIN:


c:\test\cygwin\bin\unzip \dx4w801\dx4win_regexp.zip
Archive:  \dx4w801\dx4win_regexp.zip
  inflating: pcre3.dll
  inflating: regexp/freq1.txt
  inflating: regexp/qth1.txt
  inflating: Dx4win.exe

c:\testls -l
total 3296
-rw-r--r-- 1 reisert Domain Users 3229184 Aug 14 00:20 Dx4win.exe
-rw-r--r-- 1 reisert Domain Users  140288 Mar 17  2007 pcre3.dll
drwxr-xr-x 1 reisert Domain Users   0 Aug 14 10:57 regexp


GNUWIN32:

c:\testunzip \dx4w801\dx4win_regexp.zip
Archive:  /dx4w801/dx4win_regexp.zip
  inflating: pcre3.dll
  inflating: regexp/freq1.txt
  inflating: regexp/qth1.txt
  inflating: Dx4win.exe

c:\testls -l
total 3296
-rwx--+ 1 reisert Domain Users 3229184 Aug 14 00:20 Dx4win.exe
-rwx--+ 1 reisert Domain Users  140288 Mar 17  2007 pcre3.dll
drwx--+ 1 reisert Domain Users   0 Aug 14 10:58 regexp





On Fri, Aug 14, 2009 at 10:43 AM, Jim Reisert
AD1Cjjreis...@alum.mit.edu wrote:
 Something has been bugging me about Cygwin UNZIP for years.  When I
 unzip a file, the extracted .exe and .dll files no longer have execute
 privs. I have to manually chmod +x them.  This always occurs when I'm
 in a DOS prompt and using the Cygwin unzip.

 The same unzip from http://gnuwin32.sourceforge.net doesn't have this problem.

 Why is Cygwin different?

 Thanks - Jim

 --
 Jim Reisert AD1C, jjreis...@alum.mit.edu, http://www.ad1c.us




-- 
Jim Reisert AD1C, jjreis...@alum.mit.edu, http://www.ad1c.us

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



Re: UNZIP: Why don't .exe/.dll files get eXecute privs?

2009-08-14 Thread Andrew DeFaria

Jim Reisert AD1C wrote:
Something has been bugging me about Cygwin UNZIP for years. When I 
unzip a file, the extracted .exe and .dll files no longer have execute 
privs. I have to manually chmod +x them. This always occurs when I'm 
in a DOS prompt and using the Cygwin unzip.

Why would DLLs need execute?
--
Andrew DeFaria http://defaria.com
... File not found. Should I fake it? (Y/N)


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



Re: UNZIP: Why don't .exe/.dll files get eXecute privs?

2009-08-14 Thread Charles Wilson
Andrew DeFaria wrote:

 Why would DLLs need execute?

because otherwise windows will refuse to load them, and the application
you just launched which needs that DLL will fail with an ugly message
about Failed to initialize: 0xc005.

--
Chuck

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



Re: UNZIP: Why don't .exe/.dll files get eXecute privs?

2009-08-14 Thread Andrew DeFaria

Charles Wilson wrote:

Andrew DeFaria wrote:

  

Why would DLLs need execute?



because otherwise windows will refuse to load them, and the application
you just launched which needs that DLL will fail with an ugly message
about Failed to initialize: 0xc005.
  

Really? I did not know that!
--
Andrew DeFaria http://defaria.com
All generalizations are false


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