Page 1 of 1

[SOLVED] NFS file creation permissions

Posted: Wed Nov 13, 2019 5:26 am
by André HJ
I have a problem with file permissions on files created directly in NFS volumes on my QNAP NAS: they always get 660 rather than going through the current umask.

Example:

Code: Select all

$ for UMASK in 0000 0002 0022 0222; do umask $UMASK; touch on_{local,centos,qnap}/test_$UMASK; done; umask 0022
$ l on_*/test*
-rw-rw-rw-  1 andrej andrej 0 Nov 12 20:24 on_centos/test_0000
-rw-rw-r--  1 andrej andrej 0 Nov 12 20:24 on_centos/test_0002
-rw-r--r--  1 andrej andrej 0 Nov 12 20:24 on_centos/test_0022
-r--r--r--  1 andrej andrej 0 Nov 12 20:24 on_centos/test_0222
-rw-rw-rw-  1 andrej andrej 0 Nov 12 20:24 on_local/test_0000
-rw-rw-r--  1 andrej andrej 0 Nov 12 20:24 on_local/test_0002
-rw-r--r--  1 andrej andrej 0 Nov 12 20:24 on_local/test_0022
-r--r--r--  1 andrej andrej 0 Nov 12 20:24 on_local/test_0222
-rw-rw----+ 1 andrej andrej 0 Nov 12 20:24 on_qnap/test_0000
-rw-rw----+ 1 andrej andrej 0 Nov 12 20:24 on_qnap/test_0002
-rw-rw----+ 1 andrej andrej 0 Nov 12 20:24 on_qnap/test_0022
-rw-rw----+ 1 andrej andrej 0 Nov 12 20:24 on_qnap/test_0222
$ df -h on_local/; df -h on_centos/; df -h on_qnap/
Filesystem                 Size  Used Avail Use% Mounted on
/dev/mapper/argonath-home  168G   44G  116G  28% /home
Filesystem      Size  Used Avail Use% Mounted on
sorontil:/home  640G  4.5G  635G   1% /net/sorontil/home
Filesystem      Size  Used Avail Use% Mounted on
anduin:/Public  1.6T   98G  1.5T   7% /net/anduin/Public
This is highly annoying, and causes problems for several of my use cases. It seems to break hosting Git repositories on the NFS volumes, for instance.
I've tried numerous Linux distributions as NFS clients (including Fedora, CentOS, Debian and Enigma), all with the same result.

I contacted QNAP support about this a year and a half ago, and got the response that this is not supported.
(This is on a QNAP TS-431P2, current firmware is QTS 4.4.1 but this was the same on 4.3.x.)


Any ideas on how this breakage can be fixed or circumvented? I use my QNAP for NFS shares only, so breaking support for most other features is acceptable.

Re: NFS file creation permissions

Posted: Sat Nov 16, 2019 4:57 am
by André HJ
André HJ wrote:
Wed Nov 13, 2019 5:26 am
I have a problem with file permissions on files created directly in NFS volumes on my QNAP NAS: they always get 660 rather than going through the current umask.
...
Any ideas on how this breakage can be fixed or circumvented? I use my QNAP for NFS shares only, so breaking support for most other features is acceptable.
I think I've finally found a working solution for this. Turns out we have a QNAP NAS at work where this is working, so I've compared option differences and found the one that matters: the option Shared Folders -> Advanced Permissions -> Enable Advanced Folder Permissions has to be turned off (!). Doing that - and fixing permissions on all folders and files afterwards (since toggling that option really screws things up) seems to fix the problem.

My QNAP finally works as a NAS now 8)

Re: [SOLVED] NFS file creation permissions

Posted: Mon Mar 30, 2020 7:00 pm
by xFrAx
I was going mad with this issue as well! Didn't even find this googling for ages, luckily bumped into this before posting a new thread...awesome dude, thank you very much.