Dear All,

There is an an issue that plagues me when using git in Cygwin.

I have two developer machines, one with Linux, and one with Windows. On
the Windows machine, when I clone sources with git, everything works well.

However, when I then use rsync to copy changes from the Linux machine to
Windows, the file permissions change on all files! In turn, git complains
about a new executable permission. And chmod fails to restore the previous
state.

Currently, the only way I found to restore a useful state, is to remove
the whole directory, and clone again from git!


Here are the details:
I'm using rsync options --verbose --recursive --delete which in my eyes
should not modify permissions. I clone with rsync over the already existing,
unchanged files from git, so there should be anyways no need for rsync to
re-transfer or modify the files.

The directory in question is a subfolder on the C: drive, which is an
NTFS-formatted NVMe. I created the parent folder as a normal user, and did
not apply any special permissions. In fstab, I leave default Cygwin options.

rsync is version 3.3.0, Cygwin is version 3.5.5-1.

From acl checks, it seems that rsync would modify only one of the ACLs.
The second ACL before is "COMPANY\User:(R,W,D,WDAC,WO)", and after running
rsync is "COMPANY\User:(F)". I'm not sure what this means, but even less
I understand why rsync performs this change?


Here are the detailed permissions *before* running rsync from getfacl and
icacls:

# file: CHANGELOG.md
# owner: COMPANY+User
# group: COMPANY+User
user::rwx
group::r-x      #effective:r--
group:Authenticated Users:rwx   #effective:rw-
group:SYSTEM:rwx        #effective:rw-
group:Administrators:rwx        #effective:rw-
group:Users:r-x #effective:r--
mask::rw-
other::r--

CHANGELOG.md NULL SID:(DENY)(Rc,WEA,X,DC)
             COMPANY\User:(R,W,D,WDAC,WO)
             COMPANY\User:(DENY)(X)
             NT AUTHORITY\Authenticated Users:(DENY)(X)
             NT AUTHORITY\SYSTEM:(DENY)(X)
             BUILTIN\Administrators:(DENY)(X)
             BUILTIN\Users:(DENY)(X)
             COMPANY\User:(RX)
             NT AUTHORITY\Authenticated Users:(RX,W)
             NT AUTHORITY\SYSTEM:(RX,W)
             BUILTIN\Administrators:(RX,W)
             BUILTIN\Users:(RX)
             Everyone:(R)


After running rsync, the permissions from getfacl and icacls are:

# file: CHANGELOG.md
# owner: COMPANY+User
# group: COMPANY+User
user::rwx
group::r-x      #effective:r--
group:Authenticated Users:rwx   #effective:rw-
group:SYSTEM:rwx        #effective:rw-
group:Administrators:rwx        #effective:rw-
group:Users:r-x #effective:r--
mask::rw-
other::r--

CHANGELOG.md NULL SID:(DENY)(Rc,WEA,X,DC)
             COMPANY\User:(F)
             COMPANY\User:(DENY)(X)
             NT AUTHORITY\Authenticated Users:(DENY)(X)
             NT AUTHORITY\SYSTEM:(DENY)(X)
             BUILTIN\Administrators:(DENY)(X)
             BUILTIN\Users:(DENY)(X)
             COMPANY\User:(RX)
             NT AUTHORITY\Authenticated Users:(RX,W)
             NT AUTHORITY\SYSTEM:(RX,W)
             BUILTIN\Administrators:(RX,W)
             BUILTIN\Users:(RX)
             Everyone:(R)

All the best,

    Mario Emmenlauer

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to