]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/exportfs/exportfs.c
call gethostbyaddr to make sure that we have canonical hostname
[nfs-utils.git] / utils / exportfs / exportfs.c
index 44761f89898d69ef3ff08127665dda6560eae3c0..c012961871cd86bc4d96d9d4d992c986c47780a9 100644 (file)
@@ -132,7 +132,7 @@ exports_update(int verbose)
        nfs_export      *exp;
 
        for (exp = exportlist[MCL_FQDN]; exp; exp=exp->m_next) {
-               if (exp->m_mayexport && (!exp->m_exported || exp->m_changed)) {
+               if (exp->m_mayexport && ((exp->m_exported<1) || exp->m_changed)) {
                        if (verbose)
                                printf("%sexporting %s:%s to kernel\n",
                                       exp->m_exported ?"re":"",
@@ -228,7 +228,14 @@ exportfs(char *arg, char *options, int verbose)
 
        if ((htype = client_gettype(hname)) == MCL_FQDN &&
            (hp = gethostbyname(hname)) != NULL) {
-               hp = hostent_dup (hp);
+               struct hostent *hp2 = hostent_dup (hp);
+               hp = gethostbyaddr(hp2->h_addr, hp2->h_length,
+                                  hp2->h_addrtype);
+               if (hp) {
+                       free(hp2);
+                       hp = hostent_dup(hp);
+               } else
+                       hp = hp2;
                exp = export_find(hp, path);
        } else {
                exp = export_lookup(hname, path);
@@ -354,6 +361,8 @@ dump(int verbose)
                                c = dumpopt(c, "async");
                        if (ep->e_flags & NFSEXP_GATHERED_WRITES)
                                c = dumpopt(c, "wdelay");
+                       if (ep->e_flags & NFSEXP_CROSSMNT)
+                               c = dumpopt(c, "nohide");
                        if (ep->e_flags & NFSEXP_INSECURE_PORT)
                                c = dumpopt(c, "insecure");
                        if (ep->e_flags & NFSEXP_ROOTSQUASH)
@@ -362,6 +371,10 @@ dump(int verbose)
                                c = dumpopt(c, "no_root_squash");
                        if (ep->e_flags & NFSEXP_ALLSQUASH)
                                c = dumpopt(c, "all_squash");
+                       if (ep->e_flags & NFSEXP_NOSUBTREECHECK)
+                               c = dumpopt(c, "no_subtree_check");
+                       if (ep->e_flags & NFSEXP_NOAUTHNLM)
+                               c = dumpopt(c, "insecure_locks");
                        if (ep->e_maptype == CLE_MAP_UGIDD)
                                c = dumpopt(c, "mapping=ugidd");
                        else if (ep->e_maptype == CLE_MAP_FILE)