separate permissions for files and folders?

Want something added? Ask for it here.
Post Reply
User avatar
OneCD
Sr. Member
Sr. Member
Posts: 282
Joined: March 4th, 2017, 3:47 pm

separate permissions for files and folders?

Post by OneCD » March 22nd, 2019, 6:45 pm

Hello. :)

Using SABnzbd 2.3.8 from Git source on Debian 9.8 and viewed with Firefox 65.0.1

The completed download permissions presently allow only one value:
Image

The problem is: SABnzbd is not creating files with the provided value. This value is used when creating directories, but files are written using 666 (a sensible choice as it's generally undesirable to create executable downloaded files, whereas it's necessary to ensure directories are executable so they can be read).

Would it be possible to create a second field for file permissions, instead of adapting the folder permissions value?

Thank you.
Stuff I like: Apache BASH CRON DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo S20 Python Raspberry Pi RAID SABnzbd+ SickChill Transmission Usenet VirtualBox Watcher3 WordPress XFCE

User avatar
sander
Release Testers
Release Testers
Posts: 6643
Joined: January 22nd, 2008, 2:22 pm

Re: separate permissions for files and folders?

Post by sander » March 24th, 2019, 11:35 am

I checked, my downloaded file is -rw-r--r-- , so 644 (not 666 as you say). And 644 looks OK to me.

Isn't umask a determining factor in this? A quote from https://askubuntu.com/questions/44542/w ... es-it-work
The umask acts as a set of permissions that applications cannot set on files. It's a file mode creation mask for processes and cannot be set for directories itself. Most applications would not create files with execute permissions set, so they would have a default of 666, which is then modified by the umask.
Directory is drwxr-xr-x

Code: Select all

[email protected]:~/Downloads/complete$ ll
total 56
drwxr-xr-x  4 sander sander  4096 mrt 24 17:29  ./
drwxr-xr-x 14 sander sander 40960 mrt 24 17:28  ../
drwxr-xr-x  2 sander sander  4096 mrt 24 17:29  test_download_100MB/
Downloaded file is -rw-r--r--

Code: Select all

[email protected]:~/Downloads/complete$ ll test_download_100MB/
total 102412
drwxr-xr-x 2 sander sander      4096 mrt 24 17:29 ./
drwxr-xr-x 4 sander sander      4096 mrt 24 17:29 ../
-rw-r--r-- 1 sander sander 104857600 okt 16 19:20 my_bin.bin
[email protected]:~/Downloads/complete$
My umask:

Code: Select all

$ umask
0022

User avatar
sander
Release Testers
Release Testers
Posts: 6643
Joined: January 22nd, 2008, 2:22 pm

Re: separate permissions for files and folders?

Post by sander » March 24th, 2019, 11:42 am

Playing a bit with umask:

Code: Select all

umask 0077 && sabnzbdplus 
gives different (masked) permissions:

Code: Select all

[email protected]:~/Downloads/complete$ ll
total 56
drwxr-xr-x  4 sander sander  4096 mrt 24 17:41 ./
drwxr-xr-x 14 sander sander 40960 mrt 24 17:28 ../
drwxr-xr-x  2 sander sander  4096 mrt 24 17:29 test_download_100MB/
drwx------  2 sander sander  4096 mrt 24 17:41 test_download_100MB.1/

Code: Select all

[email protected]:~/Downloads/complete$ ll test_download_100MB.1/
total 102412
drwx------ 2 sander sander      4096 mrt 24 17:41 ./
drwxr-xr-x 4 sander sander      4096 mrt 24 17:41 ../
-rw------- 1 sander sander 104857600 okt 16 19:20 my_bin.bin
[email protected]:~/Downloads/complete$

User avatar
OneCD
Sr. Member
Sr. Member
Posts: 282
Joined: March 4th, 2017, 3:47 pm

Re: separate permissions for files and folders?

Post by OneCD » March 24th, 2019, 2:04 pm

Thanks @sander, I completely forgot about umask. :-[

I withdraw my request. ;D
Stuff I like: Apache BASH CRON DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo S20 Python Raspberry Pi RAID SABnzbd+ SickChill Transmission Usenet VirtualBox Watcher3 WordPress XFCE

Post Reply