]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mountd: fix exporting of "/" with sec= setting.
authorNeilBrown <neilb@suse.de>
Fri, 19 Apr 2013 17:09:27 +0000 (13:09 -0400)
committerSteve Dickson <steved@redhat.com>
Mon, 22 Apr 2013 16:47:20 +0000 (12:47 -0400)
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>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/include/exportfs.h
support/nfs/exports.c
utils/mountd/cache.c

index 5960febf2c997fbd5b6f4c9e50928b6e096d4365..1fbf7542e9b875b25e062ffb00e7731314e11f79 100644 (file)
@@ -177,6 +177,7 @@ struct export_features {
 };
 
 struct export_features *get_export_features(void);
 };
 
 struct export_features *get_export_features(void);
+void fix_pseudoflavor_flags(struct exportent *ep);
 
 /* Record export error.  */
 extern int export_errno;
 
 /* Record export error.  */
 extern int export_errno;
index 6c08a2ba9ad54e2d4ce230dab71a6df9da8bab03..dea040f1006eb830f13a031d1a55dce80555867d 100644 (file)
@@ -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:
  */
  * 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;
 {
        struct export_features *ef;
        struct sec_entry *p;
index e1027f3d35d2dbec56883f34c43af04088016cd1..737927c78e8549c83ccf358b0f1636f353d303b6 100644 (file)
@@ -737,6 +737,7 @@ static void write_secinfo(FILE *f, struct exportent *ep, int flag_mask)
                /* There was no sec= option */
                return;
        }
                /* 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++) {
        qword_print(f, "secinfo");
        qword_printint(f, p - ep->e_secinfo);
        for (p = ep->e_secinfo; p->flav; p++) {