From: NeilBrown <neilb@suse.de>
To: Steve Dickson <SteveD@redhat.com>
Cc: NFS <linux-nfs@vger.kernel.org>
Subject: [PATCH: nfs-utils] mountd: fix exporting of "/" with sec= setting.
Date: Thu, 11 Apr 2013 11:01:50 +1000 [thread overview]
Message-ID: <20130411110150.39f127aa@notabene.brown> (raw)
[-- Attachment #1: Type: text/plain, Size: 1868 bytes --]
Commit 91bb95f2689e84856ecdf6fac365489d36709cf9
4set_root: force "fsid=0" for all exports of '/'
set NFSEXP_FSID for the export of "/" if nothing else had any fsid set,
however it didn't also set the flag for all security flavours. So the
kernel complains that the flags on the security flavours don't match and
it rejects the export.
So call fix_pseudoflavor_flags() in write_secinfo() to make sure that
any fiddling that has been done to e_flags gets copied to e_secinfo.
Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/support/include/exportfs.h b/support/include/exportfs.h
index 5960feb..1fbf754 100644
--- a/support/include/exportfs.h
+++ b/support/include/exportfs.h
@@ -177,6 +177,7 @@ struct export_features {
};
struct export_features *get_export_features(void);
+void fix_pseudoflavor_flags(struct exportent *ep);
/* Record export error. */
extern int export_errno;
diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index 6c08a2b..dea040f 100644
--- a/support/nfs/exports.c
+++ b/support/nfs/exports.c
@@ -469,7 +469,7 @@ static void clearflags(int mask, unsigned int active, struct exportent *ep)
* ensure that the export flags agree with the flags on each
* pseudoflavor:
*/
-static void fix_pseudoflavor_flags(struct exportent *ep)
+void fix_pseudoflavor_flags(struct exportent *ep)
{
struct export_features *ef;
struct sec_entry *p;
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index 978698d..53552b3 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -735,6 +735,7 @@ static void write_secinfo(FILE *f, struct exportent *ep, int flag_mask)
/* There was no sec= option */
return;
}
+ fix_pseudoflavor_flags(ep);
qword_print(f, "secinfo");
qword_printint(f, p - ep->e_secinfo);
for (p = ep->e_secinfo; p->flav; p++) {
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next reply other threads:[~2013-04-11 1:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-11 1:01 NeilBrown [this message]
2013-04-22 17:07 ` [PATCH: nfs-utils] mountd: fix exporting of "/" with sec= setting Steve Dickson
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=20130411110150.39f127aa@notabene.brown \
--to=neilb@suse.de \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).