Web lists-archives.com

Re: Filemode change by windows applications




Greetings, Eliot Moss!

> On 3/28/2018 10:40 AM, Eliot Moss wrote:
>> On 3/28/2018 10:11 AM, Andrey Repin wrote:
>> 
>>>> and is there anything I can do to prevent windows
>>>> applications from setting the execute bit on my files?
>>>
>>> No, and you will be unable to use Windows associations, if you clear execute bit
>>> on documents.
>> 
>> Interesting that you think so, Andrey.  I just tested this on my Windows 10
>> Surface Book.  I used Windows Explorer to navigate to a folder where I had
>> cleared the x bits from a .docx file (setting mode to 660 with chmod in
>> Cygwin), and clicking on the file opened Word on the file just fine.  Maybe
>> this behavior is dependent on some other things as well?

> Here is getfacl output for the file in question:

> # file: Progress Letters S16.docx
> # owner: moss
> # group: moss
> user::rw-
> group::---
> group:SYSTEM:r-x                        #effective:r--
> group:Cygwin:rwx                        #effective:rw-
> mask:rw-
> other:---

If you ANSOLUTELY remove execute bit (this is often happens on samba shares
managed by POSIX ACL for example, when you create file with POSIX tools before
Samba have a say about permissions), things break hard.

> So there are underlying x bits of some kind, but Cygwin does display
> mode 660 via ls -l (for example).

> Still, we entirely agree that there is not really a way to prevent a
> Windows program from setting the x bits.  Here is getfacl from another
> file in the same folder, reflecting how Word sets the permissions:

> # file: Progress Letters S17.docx
> # owner: moss
> # group: moss
> # flags: -s-
> user::rwx
> group::---
> group:SYSTEM:r-x
> group:Cygwin:rwx
> mask:rwx
> other:r-x

> I think the key difference is "mask".

Cygwin way of treating Windows ACL's is still kind of mystery to me.
I know they works… somehow. But I prefer to stay away from them, where
possible. I need interoperability over "zealous POSIX compatibility".


-- 
With best regards,
Andrey Repin
Wednesday, March 28, 2018 19:10:43

Sorry for my terrible english...
--
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