morpheus65535 / bazarr

Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you.
https://www.bazarr.media
GNU General Public License v3.0
2.76k stars 216 forks source link

Permission denied if not owner #2580

Closed AnonymousX86 closed 1 week ago

AnonymousX86 commented 1 month ago

Describe the bug Bazarr can't save files if user is not owner of desired directory or directory is not protected (chmod o=rwx).

To Reproduce

  1. Create user bazarr with group.
  2. Create user radarr with group.
  3. Add user bazarr to group radarr.
  4. Change /movies directory ownership to radarr:radarr.
  5. Apply permissions lesser than o=rwx, e.g. 0775.
  6. Run Bazarr with PUID and PGID of bazarr.
  7. Bazarr can't save subtitles due to "Errno 13: permission denied".

Expected behavior Bazarr should save subtitles, as it has sufficient permission to directory (g=rwx).

Screenshots Shell output and logs below.

Software

Additional context Example:

$ cd /movies
$ ls -l | grep Dune
drwxrwxr-x 2 radarr radarr 4096 Jun  1 01:29 Dune
$ ls -l Dune
total 2539684
-rwxrwxr-x 1 radarr radarr 2599600403 Jun  1 01:28 'Dune.mp4'
-rwxrwxr-x 1 radarr radarr     175894 May 26 12:09  fanart.jpg
-rwxrwxr-x 1 radarr radarr       8626 Jul 12 12:21  movie.nfo
-rwxrwxr-x 1 radarr radarr     837275 May 26 12:09  poster.jpg
$ groups bazarr
bazarr : bazarr sonarr radarr

Docker logs:

15 23:34:16,679 - root                             (7fd7b968bb38) :  ERROR (download:99) - BAZARR Error saving Subtitles file to disk for this file /movies/Dune/Dune.mp4: PermissionError(13, 'Permission denied')

Issue does not occur when applying o=rwx permissions. Subtitles are being saved with bazarr:bazarr ownership with 644 permissions.

$ ls -la
drwxrwxrwx 1 sonarr sonarr     12288 Jul 15 21:55 .
-rw-r--r-- 1 bazarr bazarr     22448 Jul 15 21:55 Dune.srt
TheAmitMa commented 1 month ago

I’m dealing with the same issue

morpheus65535 commented 1 month ago

Could you please enable debug log, reproduce the issue and provide the log file?

morpheus65535 commented 1 week ago

No news, good news!