]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/export/xtab.c
libexport.a: xtab.c no longer needs #include xmalloc.h
[nfs-utils.git] / support / export / xtab.c
index 3b1dcce325493fec61fbb5385b9a89aadff8da84..e953071ea901dfc0c9ff0c03946acf98471f11a1 100644 (file)
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
-#include "xmalloc.h"
+
 #include "nfslib.h"
 #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 */