Page 1 of 1
Permission's not being set recursively [ZFS/Solarish)
Posted: July 1st, 2012, 7:56 pm
by SpankIt
I recently upgraded to SABnzbd 0.7.0 and am having some issues with the permission's not being applied to downloads recursively. SABnzbd is configured with permissions 0775 and only the downloaded NZB's folder has this permission set. The files within the ZFS's folder however only have 0666 permissions set on it. The permissions setting I have set in SABnzbd does make a difference at all. The end result is always the same. Is there any particular reason that this is happening?
Re: Permission's not being set recursively
Posted: July 2nd, 2012, 12:28 am
by ljw1
I have not had any success with getting sab to apply the set permissions on solaris. You might want to look at creating a script to achieve what you need.
Re: Permission's not being set recursively
Posted: July 2nd, 2012, 11:05 am
by SpankIt
I've been looking at going that route as well. Thanks for the heads up.
Re: Permission's not being set recursively
Posted: July 15th, 2012, 1:34 pm
by shypike
I recently checked this feature again.
The full folder tree is parsed, with folders getting their X-bit set (when the appropriate R bit is set).
I did, however, only test on Linux systems with vanilla EXT2/3/4 filesystems.
SABnzbd uses a standard Python call to set permissions (os.chmod),
so possibly this fails on ZFS systems?
I have no such system available for testing.
spankit: did things work for you when using release 0.6.15?
Both: I assume that you actually have a permissions setting in Config->Folders?
Re: Permission's not being set recursively
Posted: August 17th, 2012, 1:26 pm
by SpankIt
The only way I was able to make it work was to create a post processing script to set the proper ACL on the folders and directories. Solaris (and other Solaris based OS's) have a different acl system for applying permissions on files. I am only assuming that it is a limitation within SAB that does not support these acl's.
Re: Permission's not being set recursively
Posted: August 17th, 2012, 3:54 pm
by shypike
SABnzbd is written in Python.
All Python has available is the standard Posix API.
Re: Permission's not being set recursively
Posted: September 13th, 2014, 4:53 pm
by SpankIt
For those of you wondering what I used as a script to make this happen here is my latest version.
Code: Select all
#!/bin/sh
### SYSTEM CONFIGURATION ###
PATH=/usr/bin:/bin
# Root directory where files are located.
ROOTDIR=/tank/files
# Get category folder name with proper case
CATDIR=$(ls $ROOTDIR | grep -i "^$5$")
echo $CATDIR
echo Setting Premissions on $CATDIR Folder
chmod A=user:dlmgr:rwxpdDaARWcCos:fd-----:allow $ROOTDIR/$CATDIR
chmod A+user:root:rwxpdDaARWcCos:fd----I:allow $ROOTDIR/$CATDIR
chmod A+owner@:rwxpdDaARWcCos:fd-----:allow $ROOTDIR/$CATDIR
chmod A+group@:rwxpdDaARWcCos:fd-----:allow $ROOTDIR/$CATDIR
chmod A+everyone@:r-xp--a-R-c--s:fd-----:allow $ROOTDIR/$CATDIR
echo Setting Premissions on "$1"
chmod -R A=user:dlmgr:rwxpdDaARWcCos:fd-----:allow "$1"
chmod -R A+user:root:rwxpdDaARWcCos:fd----I:allow "$1"
chmod -R A+owner@:rwxpdDaARWcCos:fd-----:allow "$1"
chmod -R A+group@:rwxpdDaARWcCos:fd-----:allow "$1"
chmod -R A+everyone@:r-xp--a-R-c--s:fd-----:allow "$1"
Running this script since my recent upgrade to OmniOS.