Files on cygwin are created with wrong permissions

1

I swiched to a new box at work and copied over my whole cygwin folder via rsync from the old box to the new one. But now if I do touch tmp, the file gets 060 permissions and not 644 like before. This is very disturbing, as not even cat <<<foo works but errors out with bash: cannot create temp file for here-document: Permission denied.

Vampire

Posted 2016-08-19T12:26:14.587

Reputation: 193

Which parameters did you use for rsync ? By default, file permissions are not preserved. – Eugen Rieck – 2016-08-19T12:43:07.513

rsync -avh --progress ... so yes, permissions are preserved. Also I'm not complaining about the permissions of existing files, but newly created ones. Existing files are fine – Vampire – 2016-08-19T12:46:27.820

To sanitize the ACLs, a -b switch was added to setfacl setfacl -b foo see http://superuser.com/a/1092296

– phau – 2017-02-10T21:23:00.943

Answers

1

It seems this was an issue with the NTFS permissions. I also was not able to access the folders via Windows Explorer. After fixing the Windows permissions it works now as expected.

Vampire

Posted 2016-08-19T12:26:14.587

Reputation: 193

How did you fix it? – Alex Quinn – 2019-09-10T12:48:57.150

1As I said, I fixed the windows permissions. As far as I remember I opened the security properties in windows explorer, took ownership, removed all wonky permissions, added proper permissions, and force-inherited the permissions to children. – Vampire – 2019-09-10T15:41:37.910

0

New files get permissions according to set umask. Do umask 022 for example and try again.

Matija Nalis

Posted 2016-08-19T12:26:14.587

Reputation: 2 107

That is the umask in effect – Vampire – 2016-08-19T22:20:27.823

0

When using rsync a problem might be if the user on the old computer doesn't exist on the new one. In this case you might get the files saying that the user is the one on the old machine or the user is nobody. If this happens you might not have the permissions on your user to edit/modified (or even access) the synchronized data.

Viorel Mirea

Posted 2016-08-19T12:26:14.587

Reputation: 1

Nope, was a domain user that was identical and has the UID on the old and new system. Just the Windows permissions were somehow borked. After correcting those it worked as I wrote in my self-answer. :-) – Vampire – 2016-08-26T13:41:05.093