-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SABnzbd seems to be installed with a missing/incorrect "permissions" setting #4940
Comments
Please read the wiki about this subject! You have to give the "system internal user" from the packages you want to give access to those folders the correct permissions yourself via the control panel, shared folders, select folder, click permissions, select "System internal users" and give the sc-radarr and sc-nzbdrone users the correct permission on SabNzbd share. As of DSM 7 this cannot be done by the installation scripts of packages. |
Yep, I had done that, but somehow it doesn't stick to folders created inside it. So for example I can check that SABnzbd's root share has R/W permissions for all the relevant system internal users, and that the directories inside also have them. But any directory created by SABnzbd inside the Am I possibly missing some setting on the share to set the default ACLs on new directories and files? |
Of course there is no write permission for everyone that would be a gross security risk. A better Idea would be to create a group and give that group write permissions in the SabNzb setting. And Linux does not have a delete permission, only read, write and execute. |
Yes, that's the setting I changed. I could indeed put both the SABnzbd and Sonarr/Radarr/etc users in a common group, and set that setting to 0775... but I don't think we can do that via DSM? (I can't find a way) We would need to go fiddle with DSM's internal users directly via SSH, no? For me, the Note that the SABnzbd directories (the share root and the Anyway my point here is that, unless there's something unusual about my box somehow, SABnzbd doesn't work as expected when installed, even after following the instructions on the wiki. I'm good with either amending the wiki instructions or fixing the installation scripts or both.... and if some people report that it worked OK out of the box for them, I'd love to hear about it and see what's different with my setup. |
Digging a bit further into my setup, I wonder if the installation of SABnzbd missed adding its service user to some groups. My Surely it should have been added to the download and media groups? It looks like it's doing it only for DSM6 and below. Why? |
As of DSM 7 it is no longer possible to add users to a group by the installation scripts. You clearly did not follow (or understand) the directives of the wiki. Some people reported problem in doing so but I could not reproduce that, so if it gives problems it would be advised to use folders that are created by the sabnzbd installation and not use existing folders. |
Thanks for the info. AFAICT I followed the wiki correctly but I'll start from the beginning, with as much detail as I can provide, in case I missed something.
However, after running into permission problems, I observed the following:
I hope this helps. |
I'm having similar problems. I currently have the following user/group/permissions scheme setup for the downloads and media folder trees:
All of the associated After experimenting with "Permissions for Completed Downloads" set at 777, I noticed when SABnzbd moves the file from the incomplete download folder to the category folder where Sonarr/Radarr/Lidarr/etc. watch for the file, SABnzbd creates those folders with these users/groups and permissions:
Presumably SABnzbd should be creating folders using the I reckon I could use 775 permissions if the correct group was assigned to the folder when created. Or do I need to assign all the local system users to the Also curious if Delete is unchecked whether SABnzbd can even delete the file if Sonarr, etc. instructs it to do so, or if Sonarr, etc. can move the file to the final destination media folder (if a Move is treated like a Copy + Delete). |
My advice would be, don't try to mess with permission setting by SabNzb and/or other applications themselves, those application don't understand the DSM permission system. The problem is that Synology switched to extended permissions also known as ACL's and if you are changing things to standard permissions outside the DSM gui, you mess thing up badly. @pittsjl |
As you can see from my steps, I didn't mess with permissions outside of DSM's interface, and outside of what the wiki told me to do. I'm curious to know why you think |
The package does not do that, it creates ACL permissions and if you set things to 0777 you revoke the ACL and the DSM permission won't work correctly anymore? I am not sure if Sabnzbd tries to set old style permissions, but if does that will mess-up the ACL's that DSM is using. |
What I meant was that the package has this
Ah, we're making progress. I took a look at SABnzbd's code and it looks like it always tries to set old-style permissions indeed, even when the permissions config is empty. I'll file an issue with that project. |
From SABnzbd 3.5.0 it will no longer force old-style permissions. |
hey @Safihre, I'm not sure this is actually working as expected given my recent experience comparing my deployment with a fresh installation of SABnzbd 3.7.1. See some experimentation I did: #5140 (comment). I find it still sometimes forces downloaded files (not folders) to have explicit permissions rather than simply inherit from the parent. |
Yes, if the files have X bits from within the archive we will forcefully remove them to prevent malicious attackers from abusing an exposed SABnzbd. |
Okay, this makes sense but depending on which are forcibly removed I've seen some files extracted with custom permissions for only 'sc-sabnzbd' and 'synocommunity' (no Everyone) but with others I only see custom permissions for 'sc-sabnzbd' only. In that instance without the 'synocommunity' group present, the files are unable to be processed by Would there be perhaps a way to only strip the bits for the 'Everyone' layer if present but leave the group in tact (or manually set it)? I can't say I fully understand the ACL stuff but would that be a good middle-ground from a security perspective? |
That's exactly what we do, we only mask out those bits. Not sure what happens after that due to DSM and ACL. On other Linux systems this works exactly as designed. |
Hmm, okay, so I set the logs to debug mode and downloaded a small music album. The logs are found here: https://pastebin.com/0xjPspP7. In this example the files extracted looked like this: Of course, Lidarr could not process them with these permissions and threw errors. Looking at the debug log these lines seem to be relevant:
Let me know what you think. Is it behaving differently than with other Linux systems? |
The only way to set permissions on DSM 7 is to give the "System internal user" sc-sabnzbd the correct permissions on the used share. Any attempt to use the old style permissions will not work because DSM uses the Linux extended permission system (ACL+) |
I'm not sure I get your meaning @BenjV. The permissions are correct for the used share per the FAQ on this. The concern is that extracted files from archives sometimes have their permissions set to values which differ from what they would normally inherit. This difference sometimes results in only having permissions for 'sc-sabnzbd' (as seen above) which results in other When you mention that setting old style permissions "will not work", do you mean that their resultant values will not be as expected? Setting old style permissions with a command like |
When an application like SABnzbd downloads a file and put it on a share folder then the "system internal user" of SabNzbd (sc-sabnzbd) needs permission on that share. When the applicatie (Sabnzbd) change the permission with "old style" Linux permission then things get messed up and stop working the way it should, because the ACL+ is removed en other "system internal users" cannot access those files anymore. For example when Sabnzbd uses torrents it needs a torrent downloader like for example transmission. The same would happen if Sabnzbd would change the permission of video files, other application would not be able to access them anymore via the standard way. If something like unzip or unrar is used with an option to keep the existing permission things also get messed up, because you don't know what that permissions are and you cannot change without messing up the DSM permission system database. As a workaround when you have files without the correct permission, you could use FileStation to add permissions. Until now it is not clear what DSM is exactly doing with the permission system, but this is what I found out about it. |
hey @Safihre, I've done some further investigation into this and I believe I have a fix which should work and I've included as PR sabnzbd/sabnzbd#2401. |
Oh interesting, thanks @mreid-tt -- I have been fighting the return of these permission bugs lately, and realized that, indeed, my Also, to be clear, on DSM7, we should have an empty "Permissions for completed downloads" setting, correct? (i.e. Sabnzbd shouldn't set anything?) |
The PR that I made to look into this is evolving to have a more permanent fix. At the moment I would recommend leaving it set to '777'. At the moment leaving it blank works most of the time but there are some instances where there are still some permissions issues. |
Not a good idea to set it to '777', leave it blank so you follow the DSM settings is the better option. |
New version of SABnzbd has been published which incorporates the fix for this issue. |
Setup
Package Name: SABnzbd
Package Version: 3.3.1-49
NAS Model: DS918+
NAS Architecture: apollolake (x64)
DSM version: 7.0-41890
Expected behavior
SABnzbd should create its "completed" downloads folders and files with the correct permissions by default, so other programs such as Sonarr or Radarr can pick those downloads up and rename/move/whatever.
Actual behavior
SABnzbd is instead creating these "completed" downloads folders and files with restrictive permissions. This was reported on the SABnzbd forums, where Safihre said that the Synology package should default to
0777
for these permissions. It looks like it's not the case. A simple workaround is to go in SABnzbd's settings and force it to0777
but it shouldn't be necessary.Forum thread: https://forums.sabnzbd.org/viewtopic.php?p=125635&sid=2eb52c025749edbe5bfc5be5718f03bf#p125635
SynoCommunity package config: https://github.com/SynoCommunity/spksrc/blob/master/spk/sabnzbd/src/config.ini#L3
Steps to reproduce
1. Install SBnzbd
2. Make it download something
3. Check the permissions on the downloaded folder and files
Package log
Nothing in there (just the exec command for the process)
Other logs
N/A
The text was updated successfully, but these errors were encountered: