[Request/Offer] Sonarr tries to apply chmod settings to NTFS/FAT32 mounts

Currently I have multiple different file systems that are home to my media: NTFS, FAT32, ext4.

I am controling access via group permissions. The group that owns the media has write access and I can add users like sonarr that run Sonarr to this group to let them write to the media I want access to.

This is why I apply file modes of 664 and 775 instead of 644 and 755. This works perfectly fine on my ext4 mount. However my log is filled with warnings whenever a file is creates on the NTFS file systems. That is because NTFS is agnostic of UNIX permissions - all files are 664/775 to begin with because of how I choose to mount their file systems using /ets/fstab.

I suggest / offer to PR one of three things:

  1. Check the file mode before attempting to change it. In my case, files are alread 664, so trying to change to 664 is unnecessary. The failure can be avoided by one check beforehand.
  2. Check the file system. If it is NTFS or FAT32, don’t try to change the file’s mode on linux.
  3. Suppress the warnings if they are on NTFS/FAT32 systems.

It is worth noting that Sonarr does not require the group+write permission as the process is run by a user who owns the files it creates to begin with. 664 is just preferred by me to have consistent access control for my media and other users.

#1 seems like the most reasonable solution, both #2 and #3 are overly specific and very specific to a particular setup.

The only downside I see to #1 is that it would mean somebody has to set up his NTFS and FAT32 mounts in a way that they are compatible with their preferred Sonarr chmod settings. This means that error messages would only be avoided if the fmask and dmask of the NTFS/FAT32 mount is identical with the Sonarr setting.

I suggested #2 because to my knowledge NTFS and FAT32 are the only (common?) file-systems used on linux which do not support UNIX style file permissions and chmod/chown/chgrp.

But honestly, #1 sounds like a sane check to be implemented either way. Why should Sonarr even attempt a chmod if a successful result would be no different from not using chmod to begin with. An argument could be made, though, that this should be the responsibility of mono.

Or the underlying system call (which I presume doesn’t check either).