]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
exports: turn on pseudo exports
authorSteve Dickson <steved@redhat.com>
Tue, 1 Dec 2009 12:20:43 +0000 (07:20 -0500)
committerSteve Dickson <steved@redhat.com>
Wed, 13 Jan 2010 20:39:14 +0000 (15:39 -0500)
If a pseudo root is not defined in the export file, the
v4root_needed global variable will be set, signaling
v4root_set() create the dynamic pseudo root.

Signed-off-by: Steve Dickson <steved@redhat.com>
support/export/xtab.c
utils/mountd/auth.c

index 3b1dcce325493fec61fbb5385b9a89aadff8da84..2a43193c35a15345c053b005e46cf45eadabfe1b 100644 (file)
@@ -19,7 +19,9 @@
 #include "exportfs.h"
 #include "xio.h"
 #include "xlog.h"
+#include "v4root.h"
 
+int v4root_needed;
 static void cond_rename(char *newfile, char *oldfile);
 
 static int
@@ -36,6 +38,8 @@ xtab_read(char *xtab, char *lockfn, int is_export)
        if ((lockid = xflock(lockfn, "r")) < 0)
                return 0;
        setexportent(xtab, "r");
+       if (is_export == 1)
+               v4root_needed = 1;
        while ((xp = getexportent(is_export==0, 0)) != NULL) {
                if (!(exp = export_lookup(xp->e_hostname, xp->e_path, is_export != 1)) &&
                    !(exp = export_create(xp, is_export!=1))) {
@@ -48,6 +52,8 @@ xtab_read(char *xtab, char *lockfn, int is_export)
                case 1:
                        exp->m_xtabent = 1;
                        exp->m_mayexport = 1;
+                       if ((xp->e_flags & NFSEXP_FSID) && xp->e_fsid == 0)
+                               v4root_needed = 0;
                        break;
                case 2:
                        exp->m_exported = -1;/* may be exported */
index 5a7ff8cd0fb81239eb5b717db3749bc7a665f196..2ed80bcfaef4aa6e4a37da9ca0034c20ae908317 100644 (file)
@@ -20,6 +20,7 @@
 #include "exportfs.h"
 #include "mountd.h"
 #include "xmalloc.h"
+#include "v4root.h"
 
 enum auth_error
 {
@@ -102,6 +103,8 @@ auth_reload()
        memset(&my_client, 0, sizeof(my_client));
        xtab_export_read();
        check_useipaddr();
+       v4root_set();
+
        ++counter;
 
        return counter;