viveris / uMTP-Responder

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

Folder creation ignores umask config #70

Closed OldManYellsAtCloud closed 2 years ago

OldManYellsAtCloud commented 2 years ago

In case umask config is specified in the config, it is only applied on newly created files, but not on folders.

Reproduction:

  1. Run uMTP-responder with a umask config. I used 111.
  2. Connect to a host, and create a folder on the storage.
  3. In the newly created folder create a new file.
  4. On the Linux host where uMTP-responder is running, check the newly created folder and file.

Expected result: both the folder and the file inside the folder have the same permissions, specified by the umask config.

Actual result: the file has correct permissions, but the folder comes with 700 permissions. Using a different Linux user the file might be accessible on its own, but the folder that contains it is not accessible.