symbolic link curiousity in 3.6.0
Corinna Vinschen
corinna-cygwin@cygwin.com
Sat Mar 29 12:41:25 GMT 2025
On Mar 29 13:12, Corinna Vinschen via Cygwin wrote:
> On Mar 29 12:43, Bruno Haible via Cygwin wrote:
> > OK, and what does this mean for the *files* created in such a directory?
>
> Just for clarity, permissions in Windows are *always* defined by an ACL.
> There's no such thing as default POSIX perms. Don't try to look at
> non-Cygwin-created files from a POSIX permission POV, it's a lost cause.
>
> But your question was specificially about files created in the above
> dir:
>
> - Files created by a Cygwin process inside that dir will have only the
> usual three ACL entries constituting standard POSIX permission bits,
> combined with their umask, i.e.:
>
> $ cd /tmp/glo1FkFx/tmpdir0
> $ umask
> 22
> $ touch foo
> $ getfacl foo
> # file: foo
> # owner: corinna
> # group: vinschen
> user::rw-
> group::r--
> other::r--
>
> - Files created by non-Cygwin processes inside that dir will have by
> default(*) only the usual three ACL entries constituting standard
> POSIX permission bits, but there's no umask handling in the non-Cygwin
> process, i.e.
>
> $ cd /tmp/glo1FkFx/tmpdir0
> $ cmd
> C:\cygwin64\tmp\glQatIoG\tmpdir0>echo foo > bar
> C:\cygwin64\tmp\glQatIoG\tmpdir0>exit
> $ getfacl bar
> # file: bar
> # owner: corinna
> # group: vinschen
> user::rwx
> group::r-x
> other::r-x
>
> (*) Most Windows processes rely entirely on the permissions in
> the ACLs and the Windows ACL inheritance rules.
>
> Does that answer your question?
> [...]
> For non-Cygwin-generated files, there's no such thing as a standard ACL,
> and the Cygwin user, looking from the POSIX perspective when using it,
> should see the '+'-sign to notice this file has no POSIX permissions.
Erm... except for non-Cygwin-generated files created in a Cygwin-created
dir, as outlined in the above example, in which case the inherited
default permissions emulate POSIX permissions and acl_extended_file() on
them returns 0.
I wasn't sure this was clear from the example...
Corinna
More information about the Cygwin
mailing list