I’ve played with chmod on Synology NAS a little bit. Synology uses ACLs, ls -le
displays them:
$ ls -led x
drwxrwxrwx+ 1 sc-syncthing syncthing 530 May 14 14:28 x
[0] user:sc-syncthing:allow:rwxp-DaARWc--:fd-- (level: 0)
[1] everyone::allow:r-x---a-R-c--:fd-- (level: 0)
[2] group:syncthing:allow:r-x---a-R-c--:fd-- (level: 0)
[3] group:administrators:allow:rwxpdDaARWc--:fd-- (level: 4)
[4] group:sc-syncthing:allow:rwxpdDaARWc--:fd-- (level: 4)
The + sign at the end of the attributes denotes that there are extended attributes present (the ACL), which can be displayed with the -e flag. “level:4” denotes that the privilege is inherited from /volume1
directory, “level:0” privileges are set for x
directory explicitly.
The important thing is that whenever you perform changes using normal chmod
, you loose the + sign and the ACL. You cannot reset to the initial state (with inherited ACLs) using normal chmod
. (You can manage ACLs using chmod
, though.)
$ chmod 777 x
$ ls -led x
drwxrwxrwx 1 sc-syncthing syncthing 530 May 14 14:28 x
When you create a new directory, its privileges are inherited:
$ mkdir z
$ ls -led z
drwxrwxrwx+ 1 správce users 0 May 15 09:23 z
[0] group:administrators:allow:rwxpdDaARWc--:fd-- (level: 4)
[1] group:sc-syncthing:allow:rwxpdDaARWc--:fd-- (level: 4)
So, indeed, whenever Syncthing uses chmod, it breaks the ACLs and privilege inheritance, and it has no means how to revert this. Hence, Ignore Permissions should be always checked on Synology NAS. (However, when syncing from Android, ST does NOT execute chmod for some reason, so in this case the privileges are set correctly.)