delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/12/20/10:46:10

X-Spam-Check-By: sourceware.org
Date: Tue, 20 Dec 2005 10:45:55 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Steve Holden <steve AT holdenweb DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Setting cygwin permissions from Windows programs
In-Reply-To: <do94mk$kmv$1@sea.gmane.org>
Message-ID: <Pine.GSO.4.63.0512201042040.24778@slinky.cs.nyu.edu>
References: <do8oog$bds$1 AT sea DOT gmane DOT org> <43A80BC9 DOT 2060908 AT cygwin DOT com> <do94mk$kmv$1 AT sea DOT gmane DOT org>
MIME-Version: 1.0
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

On Tue, 20 Dec 2005, Steve Holden wrote:

> Larry Hall (Cygwin) wrote:
> > Steve Holden wrote:
> >
> > > I am writing a Python program to generate file trees to be
> > > distributed to a Linus machine using Cygwin's scp. As the GUI to
> > > this program uses wxPython, a native Windows approach is the most
> > > straightforward.
> > >
> > > Is there any way to set permissions on the output files from the
> > > Windows side that will result in predictable permissions when the
> > > output tree is viewed from Cygwin?
> > >
> > > A Python recipe would be useful, but I'll take what I can get!
> >
> >
> > Have you checked what the permissions on a file you created by Windows
> > looks like under Cygwin and seen some problem?  If so, please post the
> > details and perhaps someone can help.  Otherwise, I'd suggest just
> > doing the above and working with the result unless you see problems.
> > In general, unless you've done something to restrict access in
> > Windows, Cygwin can see and interact with "natively created" files
> > just fine.
>
> Holger Krull wrote:
> > Cygwin doesn't have an own management of permissions. So any program
> > that modifies permission in Windows will be able to change permissions
> > for cygwin files. cacls and xcacls are command line tools from
> > windows. Don't know how this would be usually done in python.
>
> Thanks for the responses. The issue is that I'd like the files to appear in
> Cygwin with permissions of -rwxr--r--, or -rwxr-xr-x for executables and
> directories.
>
> I'm trying to avoid having to use Cygwin utilities to assert Cygwin
> permissions, but I am unable to determine the Windows permissions I must
> assert when creating the files in order for Cygwin to see those
> permissions. Currently a newly created file appears as:
>
> -rwx------  1 sholden None 13834 Dec 20 14:26 index.html
>
> This is under Win XP. Are the Cygwin and Windows permissions different
> universes that don't interact?

To clarify what Holger said: on NTFS, Cygwin does not do its own
permission management -- it uses the ACLs on the underlying filesystem and
maps them to Unix-style permissions.  You can experiment with this mapping
by playing with the Cygwin getfacl/setfacl tools (or use cacls, but I
found the getfacl output much more palatable).  Once you understand how
the mapping works, you can change the ACLs appropriately to get the right
Unix permission bits from Cygwin.

FYI, on FAT filesystems, Cygwin can emulate permissions using NTEA, but
those will need to be changed via Cygwin itself -- Windows won't know
anything about them, and so none of the pure Windows tools can be used to
change them.
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

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