Unable to set default UMASK using Syncthing

Hi. I've been trying without success to change the default UMASK to 002 (from 022) when running Syncthing (default openwrt package). The reason I need this is, I want to access (and edit/delete) the files created by syncthing on the router using a PC via SAMBA. The way I envision this is by adding the samba user to the group "syncthing", then setting the permission of files to allow group write.

What I'm having trouble with is setting the UMASK=002 variable or runing "umask 002" in the syncthing scripts. I've tried editing /etc/init.d/syncthing and adding "UMASK=002" and/or "umask 002", to no avail. I admit that I have no experience with the PROCD system openwrt uses to run syncthing as a daemon, and syncthing has no config (in LUCI or in the web interface) for this nor a command line option for umask.

For the moment, I'm recursively changing the permissions with "chmod -R ug+rw" of syncthing folders, but when I create a new folder in the ST web interface or some device syncs new files, these do not get group write permissions. Can someone point me in the right direction?

To my knowledge umask only automatically restricts new files' permissions. It removes permissions, but does not give them.

The restriction is applied to the permission that is implicitly or explicitly set at the file/dir creation request. 002 would mean that the write bit of 'anybody' is cleared, but does nothing for group permission. But the group 0 does not mean that group would be automatically given rwx if not requested in the creation call.

To me it sounds that you might need to patch syncthing.