A Syncthing server (v1.18.6 “Fermium Flea” (go1.17.6 linux-amd64))on Red Hat Enterprise Linux release 8.5 (Ootpa) server with a shared folder on a mounted samba share.
syncthingv1.18.3 (google play) on android syncing to the server
Result
All files have DOS hidden flag en archive flag enabled. Causing them to appear invisible when mounting the same samba share on a windows computer.
Manually writing a file on the server to the samba share does not set the hidden flag.
To be clear, none of the files are starting with a dot.
Expected
synced files should not have the DOS hidden flag, what is causing this
Echoing myself from the issue, the code we have for setting and unsetting the hidden bit when compiled for a Unixy OS is a no-op.
I think the blame lies elsewhere. What Syncthing does though is create every file as something like .filename.txt.syncthing.tmp and then rename it to filename.txt or whatever. Perhaps something else is interacting oddly with the file being created as a dotfile.
It seems like this may be a Samba feature from just Googling the issue:
OK, so it seems that samba additionally sets the H attribute in the storedDOS attributes when creating a dot file and having set "hide dot files =yes".
We do a lot of file operations in quick succession when finishing up a file (writing, closing, syncing, setting permissions, setting modtime, renaming, syncing the parent directory, etc). All quite legal and proper, but I could see how that could tickle some timing or cache related issue somewhere in the chain.