Page 1 of 1

Folder Permissions

Posted: November 10th, 2010, 6:56 am
by Infi
Hi all

I'm using SABnzbd on my Synology DS109 and have come across an odd permissions problem.

Synology recently updated their DSM to version 3, and with it the ability to set Windows type permissions on the NAS shares.  Now I've got it all set up the way I want, but I'm having a problem with SAB not respecting the permissions I've set.

The Windows ACL has been set so that one group has full control and the other has modify.

Image

I'm not much of a Linux guru, but I understand 777 is everyone full control, which is what I've set in the SAB control panel.  However, every time SAB downloads and extracts a file, it seems to be giving different permissions.

Image

As you can see, modify permission isn't there, and specifically there's no delete permission.

I guess my question is, isn't there a way to get SAB to inherit the folder permissions when it extracts a file?  Surely it's just a copy operation?  I've tried not setting the flag at all in the SAB control panel, but that's even worse as I just get read permission then.

At the moment I'm having to log into the NAS Files Station and reset the owner so I can change the permissions manually.

All help gratefully received.

Re: Folder Permissions

Posted: November 10th, 2010, 7:23 am
by shypike
If your system uses Windows ACL, then you shouldn't also set a umask in SABnzbd.
Just make it empty and SABnzbd will not bother about it anymore.
On Windows it assumes that ACL inheritance will take care of things.

Re: Folder Permissions

Posted: November 10th, 2010, 9:32 am
by Infi
Thanks for the reply.

I've tried clearing the 777 flag from the permissions box, but when I do, everything comes in as read-only, I get read/write (but no delete) with 777 in, but whether I clear the box or put something in there, the Owner and file permissions are wrong.  I'm not sure why, because it should (as far as I understand) be inheriting the folder permissions.  It keeps setting unix file permissions no matter what I'm trying so far (as per 2nd image above).

Re: Folder Permissions

Posted: November 13th, 2010, 6:44 am
by Infi
shypike wrote: If your system uses Windows ACL, then you shouldn't also set a umask in SABnzbd.
Just make it empty and SABnzbd will not bother about it anymore.
On Windows it assumes that ACL inheritance will take care of things.
Ok, I've had another go with the permissions box empty.

Image

And the result is:

Image

So as you can see it's not working. 

Root has read and write permissions and nobody else has any permissions at all.  According to the folder permissions I've got set for both the temporary and completed download folders, the permissions should be totally different on these files when they're downloaded (as per image 1 in first post).

Re: Folder Permissions

Posted: November 13th, 2010, 10:08 am
by shypike
My guess is that Python sets the default permissions on file creation.
As Linux doesn't have the concept of ACLs in its API, Python doesn't know how to treat them.
Probably the only solution is to create your own permissions script
and run it as a user script in post-processing.
I.e. if you can find out how to set ACLs in a script at all.

Re: Folder Permissions

Posted: November 13th, 2010, 1:58 pm
by Infi
Worth a try.  I'll have a dig around t'internet :)