From eae2fa997223ce0edb4218faf2ff67165535d21d Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" <bfields@redhat.com> Date: Tue, 29 May 2012 14:40:38 -0400 Subject: [PATCH] mountd: Honor the no_root_squash flag on pseudo roots From: "J. Bruce Fields" <bfields@redhat.com> If root squashing is turned off on a export that has multiple directories, the parent directories of the pseudo exports that's built, also needs to have root squashing turned off. Tested-by: Steve Dickson <steved@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com> --- utils/mountd/v4root.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff -up nfs-utils-1.2.3/utils/mountd/v4root.c.orig nfs-utils-1.2.3/utils/mountd/v4root.c --- nfs-utils-1.2.3/utils/mountd/v4root.c.orig 2010-09-28 08:24:16.000000000 -0400 +++ nfs-utils-1.2.3/utils/mountd/v4root.c 2012-05-29 14:35:46.070526000 -0400 @@ -61,6 +61,8 @@ void set_pseudofs_security(struct export if (source->e_flags & NFSEXP_INSECURE_PORT) pseudo->e_flags |= NFSEXP_INSECURE_PORT; + if ((source->e_flags & NFSEXP_ROOTSQUASH) == 0) + pseudo->e_flags &= ~NFSEXP_ROOTSQUASH; for (se = source->e_secinfo; se->flav; se++) { struct sec_entry *new; @@ -91,7 +93,8 @@ v4root_create(char *path, nfs_export *ex exp = export_create(&eep, 0); if (exp == NULL) return NULL; - xlog(D_CALL, "v4root_create: path '%s'", exp->m_export.e_path); + xlog(D_CALL, "v4root_create: path '%s' flags 0x%x", + exp->m_export.e_path, exp->m_export.e_flags); return &exp->m_export; }