public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Kjetil Østerås" <kjetilos@gmail.com>
To: moss@cs.umass.edu, cygwin@cygwin.com
Subject: Re: Filemode change by windows applications
Date: Wed, 28 Mar 2018 14:40:00 -0000	[thread overview]
Message-ID: <CAFeO1eo4QMzD_edJjmgpMBg1YtRX7w4vZ3QKmXW7J1ZkwqZxMA@mail.gmail.com> (raw)
In-Reply-To: <06ceaabb-dd38-881b-c900-4c695e31e95a@cs.umass.edu>

Hi Eliot,

Do you know where I can find documentation or source code that describes
the mapping that cygwin implements?

2018-03-28 15:06 GMT+02:00 Eliot Moss <moss@cs.umass.edu>:

> On 3/28/2018 3:09 AM, Kjetil Østerås wrote:
>
> I notice that when I edit and save a file in a windows application this
>> file sometimes get the execute file permission set in cygwin. Some windows
>> applications do this and some don't. For instance in my setup if i modify
>> a
>> .c file using Meld then the execute bit is set, however when I modify the
>> same file with sublime text 3 then the execute bit is not set.
>>
>> Why does this happen? and is there anything I can do to prevent windows
>> applications from setting the execute bit on my files?
>>
>
> The Windows file permissions (access control) is substantially different
> from the Posix model that Cygwin attempts to present.  The mapping from
> Windows to Posix that Cygwin implements is arguably the best / most
> reasonable mapping between the disparate schemes, and has been carefully
> refined over time.  But it is just a mapping from the underlying scheme.
>
> So, if some Windows program sets permissions a particular way, that it how
> they show up under Cygwin.  To answer your question more directly: No, you
> can't prevent a Windows program from setting (the underlying access modes
> that translate to what is presented as) the execute bit under Cygwin -
> short of preventing the programs from accessing the file altogether,
> presumably not what you want.
>
> File access translation is perhaps one of the roughest edges that Cygwin
> *tries* to smooth over.  I think it does a good job with what it has, but
> the Windows scheme is complex and there is no perfect way to do this.
>
> Note, though, that there is no good way to prevent a Unix program from
> setting execute bits on a particular file either (well, the umask, and
> possibly ACLs may give you some control if you want to go to the bother).
> It's just that Unix programs don't tend to set that bit unless they are
> creating an executable.
>
> Someone more versed in the Windows access control scheme and the intention
> of various permissions might be able to clarify why some many Windows
> programs think it is a good thing to set the access mode(s) that Cygwin
> reflects as the x bit ...
>
> Regards - Eliot Moss
>
> --
> 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
>
>


-- 
Kjetil Østerås

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

  reply	other threads:[~2018-03-28 14:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28  8:16 Kjetil Østerås
2018-03-28 13:37 ` Eliot Moss
2018-03-28 14:40   ` Kjetil Østerås [this message]
2018-03-28 16:20     ` Eliot Moss
2018-03-28 14:27 ` Andrey Repin
2018-03-28 14:45   ` Eliot Moss
2018-03-28 14:50     ` Eliot Moss
2018-03-28 16:56       ` Andrey Repin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFeO1eo4QMzD_edJjmgpMBg1YtRX7w4vZ3QKmXW7J1ZkwqZxMA@mail.gmail.com \
    --to=kjetilos@gmail.com \
    --cc=cygwin@cygwin.com \
    --cc=moss@cs.umass.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).