All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH] rpc.mountd: Turn off root_squash on pseudo roots, its not needed.
Date: Wed, 02 Jun 2010 17:14:03 -0400	[thread overview]
Message-ID: <4C06C99B.2070004@RedHat.com> (raw)

Hello,

It turns out the setting of NFSEXP_ROOTSQUASH option
on pseudo roots breaks v4 exports when the no_root_squash
is set on the 'real' export. For example,

The export:

    /home/user/dir  *(rw,no_root_squash)

the /home/user directory has the 0700 permission modes

Now from an v4 enabled client do the following mount
will fail with permission denied. 
   mount server:/home/user/dir /mnt

The reason being, the 'no_root_squash' option is only
being applied to the 'dir' part of the path. So then
root tries to lookup the 'user' part, its denied. 

Now turns out the NFSEXP_ROOTSQUASH option is not need
to be set on pseudo roots because one, they are marked
as read only and two only the export part of the path 
are exposed if by chance the actual pseudo root is 
mounted. For example:
    # mount server:/ /mnt
    # ls /mnt
     ./  ../  home/
    # ls /mnt/home
    ./  ../  user/

only the above directories would be shown and they would be 
read-only

steved.


Currently the default setting of a pseudo root is to have
NFSEXP_ROOTSQUASH enabled. This setting will cause the looking
up of real export to fail when have the no_root_squash set.

It turns the setting of NFSEXP_ROOTSQUASH is not needed on pseudo
roots for two reasons. 1) pseudo roots are marked as read-only so
they can not be written on. 2) pseudo roots only show exported
entries when they are mounted.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/mountd/v4root.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/utils/mountd/v4root.c b/utils/mountd/v4root.c
index 7fd6af3..41b77eb 100644
--- a/utils/mountd/v4root.c
+++ b/utils/mountd/v4root.c
@@ -35,9 +35,8 @@ static nfs_export pseudo_root = {
 	.m_export = {
 		.e_hostname = "*",
 		.e_path = "/",
-		.e_flags = NFSEXP_READONLY | NFSEXP_ROOTSQUASH
-				| NFSEXP_NOSUBTREECHECK | NFSEXP_FSID
-				| NFSEXP_V4ROOT,
+		.e_flags = NFSEXP_READONLY | NFSEXP_NOSUBTREECHECK | 
+				NFSEXP_FSID | NFSEXP_V4ROOT,
 		.e_anonuid = 65534,
 		.e_anongid = 65534,
 		.e_squids = NULL,



             reply	other threads:[~2010-06-02 21:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-02 21:14 Steve Dickson [this message]
     [not found] ` <4C06C99B.2070004-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2010-06-09  0:31   ` [PATCH] rpc.mountd: Turn off root_squash on pseudo roots, its not needed J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C06C99B.2070004@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.