viveris / uMTP-Responder

Lightweight USB Media Transfer Protocol (MTP) responder daemon for GNU/Linux
GNU General Public License v3.0
192 stars 52 forks source link

fix default permissions and umask handling #104

Open js731ca opened 5 months ago

js731ca commented 5 months ago

On linux files are usually created with permissions set to 666+umask, and folders with 777+umask.

The codebase used to create files with 600 and folders with 700 unless a umask override was set in the configuration, then both files and folders would end up with 777+umask.

This patch addresses this by setting the umask override on process level; Creating files with permissions set to 666 and folders set to 777 - with either the overridden or the system default umask applied.