public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* umask problem: wrong permissions for new files
@ 2018-04-20 10:04 Ulli Horlacher
  2018-04-20 12:47 ` Houder
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ulli Horlacher @ 2018-04-20 10:04 UTC (permalink / raw)
  To: cygwin

cygwin umask does not work as expected:

/tmp: uname -a; umask; rm -f zz; touch zz; ls -l zz
Linux diaspora 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
0022
-rw-r--r-- 1 framstag users 0 Apr 20 12:00 zz

/tmp: uname -a; umask; rm -f zz; touch zz; ls -l zz
CYGWIN_NT-6.1 WIN-LS0QDOSDIBL 2.10.0(0.325/5/3) 2018-02-02 15:21 i686 Cygwin
0022
-rw-rw----+ 1 admin None 0 Apr 20 12:00 zz

Why do not have new files mode -rw-r--r-- on cygwin?



-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<20180420100357.GA21217@rus.uni-stuttgart.de>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: umask problem: wrong permissions for new files
  2018-04-20 10:04 umask problem: wrong permissions for new files Ulli Horlacher
@ 2018-04-20 12:47 ` Houder
  2018-04-20 12:53   ` Houder
  2018-04-20 13:07 ` Corinna Vinschen
  2018-04-20 13:25 ` Brian Inglis
  2 siblings, 1 reply; 8+ messages in thread
From: Houder @ 2018-04-20 12:47 UTC (permalink / raw)
  To: cygwin

On Fri, 20 Apr 2018 12:03:57, Ulli Horlacher wrote:
> cygwin umask does not work as expected:
> 
> /tmp: uname -a; umask; rm -f zz; touch zz; ls -l zz
> Linux diaspora 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
> 0022
> -rw-r--r-- 1 framstag users 0 Apr 20 12:00 zz
> 
> /tmp: uname -a; umask; rm -f zz; touch zz; ls -l zz
> CYGWIN_NT-6.1 WIN-LS0QDOSDIBL 2.10.0(0.325/5/3) 2018-02-02 15:21 i686 Cygwin
> 0022
> -rw-rw----+ 1 admin None 0 Apr 20 12:00 zz
> 
> Why do not have new files mode -rw-r--r-- on cygwin?

They do.

64-@@ umask
0022
64-@@ ls -l /tmp
total 0
-rw-r--r-- 1 Henri None 0 Apr 20 14:37 junk
64-@@ touch /tmp/junk
64-@@ ls -l /tmp
total 0
-rw-r--r-- 1 Henri None 0 Apr 20 14:39 junk
64-@@ getfacl /tmp
# file: /tmp
# owner: Henri
# group: None
# flags: --t
user::rwx
group::rwx
other:rwx
default:user::rwx
default:group::r-x
default:other:r-x

64-@@ icacls e:/Cygwin64/tmp
e:/Cygwin64/tmp Seven\Henri:(F)
                Seven\None:(RX,W)
                Everyone:(RX,W)
                NULL SID:(RD)
                CREATOR OWNER:(OI)(CI)(IO)(F)
                CREATOR GROUP:(OI)(CI)(IO)(RX)
                Everyone:(OI)(CI)(IO)(RX)

Successfully processed 1 files; Failed processing 0 files

Remember, it is Windows ... So you have to work a little harder :-)

Henri


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: umask problem: wrong permissions for new files
  2018-04-20 12:47 ` Houder
@ 2018-04-20 12:53   ` Houder
  0 siblings, 0 replies; 8+ messages in thread
From: Houder @ 2018-04-20 12:53 UTC (permalink / raw)
  To: cygwin

On 2018-04-20 14:45, Houder wrote:

> 64-@@ umask
> 0022
> 64-@@ ls -l /tmp
> total 0
> -rw-r--r-- 1 Henri None 0 Apr 20 14:37 junk
> 64-@@ touch /tmp/junk
> 64-@@ ls -l /tmp
> total 0
> -rw-r--r-- 1 Henri None 0 Apr 20 14:39 junk

Sorry. Read the above as:

64-@@ umask
0022
64-@@ ls -l /tmp
64-@@ touch /tmp/junk
64-@@ ls -l /tmp
total 0
-rw-r--r-- 1 Henri None 0 Apr 20 14:39 junk

Henri

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: umask problem: wrong permissions for new files
  2018-04-20 10:04 umask problem: wrong permissions for new files Ulli Horlacher
  2018-04-20 12:47 ` Houder
@ 2018-04-20 13:07 ` Corinna Vinschen
  2018-04-20 13:25 ` Brian Inglis
  2 siblings, 0 replies; 8+ messages in thread
From: Corinna Vinschen @ 2018-04-20 13:07 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

On Apr 20 12:03, Ulli Horlacher wrote:
> cygwin umask does not work as expected:
> 
> /tmp: uname -a; umask; rm -f zz; touch zz; ls -l zz
> Linux diaspora 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
> 0022
> -rw-r--r-- 1 framstag users 0 Apr 20 12:00 zz
> 
> /tmp: uname -a; umask; rm -f zz; touch zz; ls -l zz
> CYGWIN_NT-6.1 WIN-LS0QDOSDIBL 2.10.0(0.325/5/3) 2018-02-02 15:21 i686 Cygwin
> 0022
> -rw-rw----+ 1 admin None 0 Apr 20 12:00 zz
> 
> Why do not have new files mode -rw-r--r-- on cygwin?

See the '+' at the end of the permissions.  That's `ls' way to
show that you have an ACL with additional permissions, in your
case inherited permissions from the parent dir.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: umask problem: wrong permissions for new files
  2018-04-20 10:04 umask problem: wrong permissions for new files Ulli Horlacher
  2018-04-20 12:47 ` Houder
  2018-04-20 13:07 ` Corinna Vinschen
@ 2018-04-20 13:25 ` Brian Inglis
  2018-04-26 14:38   ` Ulli Horlacher
  2 siblings, 1 reply; 8+ messages in thread
From: Brian Inglis @ 2018-04-20 13:25 UTC (permalink / raw)
  To: cygwin

On 2018-04-20 04:03, Ulli Horlacher wrote:
> cygwin umask does not work as expected:
> /tmp: uname -a; umask; rm -f zz; touch zz; ls -l zz
> Linux diaspora 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
> 0022
> -rw-r--r-- 1 framstag users 0 Apr 20 12:00 zz
> /tmp: uname -a; umask; rm -f zz; touch zz; ls -l zz
> CYGWIN_NT-6.1 WIN-LS0QDOSDIBL 2.10.0(0.325/5/3) 2018-02-02 15:21 i686 Cygwin
> 0022
> -rw-rw----+ 1 admin None 0 Apr 20 12:00 zz
> Why do not have new files mode -rw-r--r-- on cygwin?

Cygwin supports Windows ACLs as POSIX ACLs, which are also supported by Linux.
Use setfacl to set similar default ACLs (DACLs) on a Linux directory, rerun your
test there, and you should see similar results.

*Never* remove DACLs from any Windows directory which will *ever* be used with
any non-Cygwin Windows program: /undefined behaviour/ will result.
Mostly neither Cygwin nor Windows programs will be able to do anything with
those files until you fix the permissions problems using elevated commands ;^>

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: umask problem: wrong permissions for new files
  2018-04-20 13:25 ` Brian Inglis
@ 2018-04-26 14:38   ` Ulli Horlacher
  2018-04-27  9:05     ` Andrey Repin
  0 siblings, 1 reply; 8+ messages in thread
From: Ulli Horlacher @ 2018-04-26 14:38 UTC (permalink / raw)
  To: cygwin

On Fri 2018-04-20 (07:25), Brian Inglis wrote:

> Cygwin supports Windows ACLs as POSIX ACLs, which are also supported by
> Linux. Use setfacl to set similar default ACLs (DACLs) on a Linux
> directory, rerun your test there, and you should see similar results.

(How) can I completly remove ACLs from the cygwin files and directories?
The standard UNIX permissions are sufficent for my needs and much easier
to handle :-}


> *Never* remove DACLs from any Windows directory which will *ever* be used
> with any non-Cygwin Windows program: /undefined behaviour/ will result.

Uuups... thanks for the warning!



-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<6cd38c2e-2271-aaee-3263-babf905325c1@SystematicSw.ab.ca>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: umask problem: wrong permissions for new files
  2018-04-26 14:38   ` Ulli Horlacher
@ 2018-04-27  9:05     ` Andrey Repin
  2018-04-27  9:27       ` Eliot Moss
  0 siblings, 1 reply; 8+ messages in thread
From: Andrey Repin @ 2018-04-27  9:05 UTC (permalink / raw)
  To: Ulli Horlacher, cygwin

Greetings, Ulli Horlacher!

> On Fri 2018-04-20 (07:25), Brian Inglis wrote:

>> Cygwin supports Windows ACLs as POSIX ACLs, which are also supported by
>> Linux. Use setfacl to set similar default ACLs (DACLs) on a Linux
>> directory, rerun your test there, and you should see similar results.

> (How) can I completly remove ACLs from the cygwin files and directories?

You CAN, yes.
However, you will lose any way to access the files, as explained below.

> The standard UNIX permissions are sufficent for my needs and much easier
> to handle :-}

"Standard POSIX" permissions are insufficient even for most basic operations.
They survive only because removing them would cause even more harm, than
letting them sit around.

>> *Never* remove DACLs from any Windows directory which will *ever* be used
>> with any non-Cygwin Windows program: /undefined behaviour/ will result.

> Uuups... thanks for the warning!


-- 
With best regards,
Andrey Repin
Friday, April 27, 2018 11:52:38

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: umask problem: wrong permissions for new files
  2018-04-27  9:05     ` Andrey Repin
@ 2018-04-27  9:27       ` Eliot Moss
  0 siblings, 0 replies; 8+ messages in thread
From: Eliot Moss @ 2018-04-27  9:27 UTC (permalink / raw)
  To: cygwin

On 4/27/2018 4:54 AM, Andrey Repin wrote:
> Greetings, Ulli Horlacher!
> 
>> On Fri 2018-04-20 (07:25), Brian Inglis wrote:
> 
>>> Cygwin supports Windows ACLs as POSIX ACLs, which are also supported by
>>> Linux. Use setfacl to set similar default ACLs (DACLs) on a Linux
>>> directory, rerun your test there, and you should see similar results.
> 
>> (How) can I completly remove ACLs from the cygwin files and directories?
> 
> You CAN, yes.
> However, you will lose any way to access the files, as explained below.
> 
>> The standard UNIX permissions are sufficent for my needs and much easier
>> to handle :-}
> 
> "Standard POSIX" permissions are insufficient even for most basic operations.
> They survive only because removing them would cause even more harm, than
> letting them sit around.
> 
>>> *Never* remove DACLs from any Windows directory which will *ever* be used
>>> with any non-Cygwin Windows program: /undefined behaviour/ will result.
> 
>> Uuups... thanks for the warning!


Let me add this ...

What mostly work for me (occasional gotchas) is this:

I am "moss" and I added a group "Cygwin".  I have admin permissions under Windows.

A typical file acl for me has owner moss and group Cygwin - sometimes I have to
set these manually, particularly if they are created by a Windows program.

Also, typical acls for files print out as:

# owner: moss
# group: Cygwin
user::rw-
group::rwx                              #effective:rw-
group:SYSTEM:r-x                        #effective:r--
group:Cygwin:rwx                        #effective:rw-
mask:rw-
other:r--

This corresponds to Posix permissions 664.  The SYSTEM thing helps insure that
Windows programs, such as my backup program, can read the file.

Here is a typical directory acl:

# owner: moss
# group: Cygwin
# flags: -s-
user::rwx
group::rwx
group:SYSTEM:r-x
group:Cygwin:rwx
mask:rwx
other:r-x
default:user::rwx
default:group::rwx
default:group:SYSTEM:r-x
default:group:Cygwin:rwx
default:mask:rwx
default:other:r-x

This is more complex since it is intended to propagate useful permissions to
files crated within the directory.  It is the default entries that help do that.
Note the -s- flag, which encodes the 2000 (set gid) bit of Posix permissions,
enabling propagation of default permissions.  This directory's Posix permissions
are 2775.  Again, the SYSTEM entries are important for me.

A typical file created by a Windows program (Word, in this case) ends up with
this acl:

# owner: moss
# group: moss
# flags: -s-
user::rwx
group::---
group:SYSTEM:r-x
group:Cygwin:rwx
mask:rwx
other:r-x

The Posix permissions read as 2775 (rwxrwsr-x).

Some people like this way of setting things up, some don't.  As they say, YMMV.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-04-27  9:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-20 10:04 umask problem: wrong permissions for new files Ulli Horlacher
2018-04-20 12:47 ` Houder
2018-04-20 12:53   ` Houder
2018-04-20 13:07 ` Corinna Vinschen
2018-04-20 13:25 ` Brian Inglis
2018-04-26 14:38   ` Ulli Horlacher
2018-04-27  9:05     ` Andrey Repin
2018-04-27  9:27       ` Eliot Moss

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