delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/03/28/10:27:42

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type:content-transfer-encoding;
q=dns; s=default; b=jOzsk79JQYEUp6nhrTknye15rs8hxRlgKHfn7w3AE+a
8l/SmF8ZXUpIfZg8p1kfmhresmdXb6BnyBnXL0Kqj2fy+lOgxm7+jY14S7csqWkA
MNeeAZbDfPFeZijzryZF2RZKVyUqRY02wTnozL0q1SOOIJdINPni+2wldOiObL7Y
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type:content-transfer-encoding;
s=default; bh=GMDk3TkwVmOoeugUxFoeg2JmbgQ=; b=CWndIpewkpVXpxYLy
sQoMnzBTDD1TMh6Dg9yMRyPJ1EWByYi4qmxt1DgL9eR/dbNfWU4jsBqNYxSjFl4u
y5ALZKT2hRNKCauuvCdJ4Ajmc1yKhDMSHLF/GtCkyd4pg25BLwHL70RoXQJp4Qey
qAV4wDAv9I1uVBjzipQyOcXiCI=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,FROM_EXCESS_BASE64,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=H*c:alternative, perfect
X-HELO: mail-ua0-f170.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=vGueu1SFszKm0iYZyw7bKVfA0KmcR0Edct0TbStr+6E=; b=blsTbvjRKvsW5NliRCtXPbf9u6PE9ag/pYXoKQt36tHasWFXiqJPx3AXny+fxYk3sy anQrDVzcYnOs0yJW2jITca26M5AjwIrAR+3D6qZugrEvEKI37vIk1pS4hA1v6EVAev6N S+ajyOvgIvMLFz5WEd0HQlK1jF9HnZhGeWZg9V1G204ukJMXhcU47DAiycV03bxG8eIh G/YPYwS6SUSOKA/8pWhF606e6lf8pBDrE4kZXXsLCP93OBIumB5YDa+soKyw76FxVzK7 vfogRzKa35Ijk7ZmdUvDTF9Lqggy64rcZ8fHzJ2KIiGDGSJnHlNWdFvvAym7Kk6PoVPc yHwA==
X-Gm-Message-State: AElRT7FHxLi3YdV1xk1dQg7oLgbi4aSPzRmv2Wz3WmKnH6l++13zaMfw 6oX4Oe4bSurjZvrcfTIEbZoFQCk41FEwWSd59PY=
X-Google-Smtp-Source: AIpwx49iLVepiv8Zw7udDK3l5zUiWXaikvb5mmZCWHUPnu2J5DhNyZhtxN3cFITcASiRACGjtN5R+ogvKO1Srwnsmqo=
X-Received: by 10.176.32.152 with SMTP id r24mr2585031uak.170.1522247247402; Wed, 28 Mar 2018 07:27:27 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <06ceaabb-dd38-881b-c900-4c695e31e95a@cs.umass.edu>
References: <CAFeO1eoW52-4S4gD0=YL7g1YKsjjn9Jk8twV22e57HmmKQc5vg AT mail DOT gmail DOT com> <06ceaabb-dd38-881b-c900-4c695e31e95a AT cs DOT umass DOT edu>
From: =?UTF-8?B?S2pldGlsIMOYc3RlcsOlcw==?= <kjetilos AT gmail DOT com>
Date: Wed, 28 Mar 2018 16:27:26 +0200
Message-ID: <CAFeO1eo4QMzD_edJjmgpMBg1YtRX7w4vZ3QKmXW7J1ZkwqZxMA@mail.gmail.com>
Subject: Re: Filemode change by windows applications
To: moss AT cs DOT umass DOT edu, cygwin AT cygwin DOT com
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id w2SERe2O010639

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 AT cs DOT umass DOT 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


- Raw text -


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