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.
Asked
Active
Viewed 3,940 times
1
Vampire
- 273
- 3
- 10
-
Which parameters did you use for `rsync` ? By default, file permissions are not preserved. – Eugen Rieck Aug 19 '16 at 12:43
-
`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 Aug 19 '16 at 12:46
-
To sanitize the ACLs, a `-b` switch was added to setfacl `setfacl -b foo` see http://superuser.com/a/1092296 – phau Feb 10 '17 at 21:23
3 Answers
2
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
- 273
- 3
- 10
-
-
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 Sep 10 '19 at 15:41
0
New files get permissions according to set umask. Do umask 022 for example and try again.
Matija Nalis
- 2,616
- 16
- 24
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
- 101
- 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 Aug 26 '16 at 13:41