delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/07/24/05:09:23

X-Spam-Check-By: sourceware.org
Message-ID: <50be591b0607240208r31306906p4899f667efbe6a13@mail.gmail.com>
Date: Mon, 24 Jul 2006 14:38:56 +0530
From: "Hemal Pandya" <hemal DOT pandya AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: permissions on .exe files
In-Reply-To: <Pine.GSO.4.63.0607211136120.17655@access1.cims.nyu.edu>
MIME-Version: 1.0
References: <50be591b0607202319w2e9845bdp560051aa70f604a8 AT mail DOT gmail DOT com> <Pine DOT GSO DOT 4 DOT 63 DOT 0607211136120 DOT 17655 AT access1 DOT cims DOT nyu DOT edu>
X-Google-Sender-Auth: 9a9f9699b2b918db
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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

Thanks for your response , Igor.

On 7/21/06, Igor Peshansky wrote:
> On Fri, 21 Jul 2006, Hemal Pandya wrote:
>
> > Hello,
> >
> > If I create a file somefile.exe "outside cygwin" then cygwin reports
> > that it is executable. But if the file is created by cygwin then it
> > does not become executable unless explicitly set.
>
> This is correct and expected behavior.

With your explanation now I can understand that it is so.

>
> > One implication of this is that when I extract a .zip using cygwin
> > unzip then the .exe, .dll, .bat etc do not get the executable
> > permission.
>
> That's a problem with the ZIP format, which does not keep permissions.
> Try "tar".

Unfortunately I do not have control over the file creation. Regarding
permissions, zipinfo does report file permissions so they probably are
getting stored in the zip file.

>
> > Is there a way to tell cygwin to assign u+x for the files created from
> > cygwin for which it would have otherwise assumed this permission?
>
> Cygwin does not assume any permissions.  Neither does Windows.  However,
> Windows does have ACL inheritance rules that set everything to be
> executable.

I had failed to realize that windows makes everything executable. I
agree it is very annoying.

I guess I'll do "chmod -R u+x *exe *dll *bat" after the unzip.

Again, thanks for your help. It solved my doubt and suggested the
right approach.

>
> You can tell Cygwin to use default Windows permissions by temporarily
> setting CYGWIN to nontsec, i.e., run
>
> CYGWIN=nontsec unzip somefile.zip
>
> This would not assign u+x, but rather a+x.  There is no way that I know of
> to get Cygwin to automatically assign only u+x.
>
> > hpandya AT hpandya-xp2 /tmp/ll Fri Jul 21 11:47:43 2006
> > $ cmd /c "dir > in_windows.exe"
> > hpandya AT hpandya-xp2 /tmp/ll Fri Jul 21 11:47:50 2006
> > $ ls > in_cygwin.exe
> > hpandya AT hpandya-xp2 /tmp/ll Fri Jul 21 11:47:58 2006
> > $ ls -l
> > total 2
> > -rw-r--r-- 1 hpandya &-Users  29 Jul 21 11:47 in_cygwin.exe
> > -rwxr-xr-x 1 hpandya &-Users 345 Jul 21 11:47 in_windows.exe
> > hpandya AT hpandya-xp2 /tmp/ll Fri Jul 21 11:48:02 2006
>
> BTW, the above would happen even if you didn't have the .exe extension.
> Windows does not do special magic for .exe files -- it just makes
> everything executable.  A pretty annoying feature, if you ask me.
>         Igor

- hemal

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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