summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/export/export.c4
-rw-r--r--support/export/rmtab.c30
-rw-r--r--support/include/nfs/export.h6
-rw-r--r--support/nfs/exports.c12
4 files changed, 35 insertions, 17 deletions
diff --git a/support/export/export.c b/support/export/export.c
index 09efaa8..ef12056 100644
--- a/support/export/export.c
+++ b/support/export/export.c
@@ -38,14 +38,14 @@ export_read(char *fname)
export_create(eep);
else {
if (exp->m_export.e_flags != eep->e_flags) {
- xlog(L_ERROR, "incompatible dupilcated export entries:");
+ xlog(L_ERROR, "incompatible duplicated export entries:");
xlog(L_ERROR, "\t%s:%s (0x%x) [IGNORED]", eep->e_hostname,
eep->e_path, eep->e_flags);
xlog(L_ERROR, "\t%s:%s (0x%x)", exp->m_export.e_hostname,
exp->m_export.e_path, exp->m_export.e_flags);
}
else {
- xlog(L_ERROR, "dupilcated export entries:");
+ xlog(L_ERROR, "duplicated export entries:");
xlog(L_ERROR, "\t%s:%s", eep->e_hostname, eep->e_path);
xlog(L_ERROR, "\t%s:%s", exp->m_export.e_hostname,
exp->m_export.e_path);
diff --git a/support/export/rmtab.c b/support/export/rmtab.c
index 44a0edc..4d0bc02 100644
--- a/support/export/rmtab.c
+++ b/support/export/rmtab.c
@@ -25,28 +25,32 @@ rmtab_read(void)
setrmtabent("r");
while ((rep = getrmtabent(1)) != NULL) {
- exp = export_lookup(rep->r_client, rep->r_path);
- if (!exp) {
- struct exportent *xp;
- struct hostent *hp;
- int htype;
-
- htype = client_gettype(rep->r_client);
- if (htype == MCL_FQDN
- && (hp = gethostbyname (rep->r_client), hp)
- && (hp = hostent_dup (hp),
- xp = export_allowed (hp, rep->r_path))) {
+ struct exportent *xp;
+ struct hostent *hp = NULL;
+ int htype;
+
+ htype = client_gettype(rep->r_client);
+ if (htype == MCL_FQDN
+ && (hp = gethostbyname (rep->r_client))
+ && (hp = hostent_dup (hp),
+ xp = export_allowed (hp, rep->r_path))) {
+ /* see if the entry already exists, otherwise this was an instantiated
+ * wild card, and we must add it
+ */
+ exp = export_lookup(rep->r_client, xp->e_path);
+ if (!exp) {
strncpy (xp->e_hostname, rep->r_client,
sizeof (xp->e_hostname) - 1);
xp->e_hostname[sizeof (xp->e_hostname) -1] = '\0';
exp = export_create(xp);
- free (hp);
}
+ free (hp);
if (!exp)
continue;
exp->m_mayexport = 1;
- }
+ } else if (hp) /* export_allowed failed */
+ free(hp);
}
if (errno == EINVAL) {
/* Something goes wrong. We need to fix the rmtab
diff --git a/support/include/nfs/export.h b/support/include/nfs/export.h
index 80d23fd..cc88f0f 100644
--- a/support/include/nfs/export.h
+++ b/support/include/nfs/export.h
@@ -20,7 +20,9 @@
#define NFSEXP_UIDMAP 0x0040
#define NFSEXP_KERBEROS 0x0080 /* not available */
#define NFSEXP_SUNSECURE 0x0100
-#define NFSEXP_CROSSMNT 0x0200 /* not available */
-#define NFSEXP_ALLFLAGS 0x03FF
+#define NFSEXP_CROSSMNT 0x0200
+
+#define NFSEXP_NOSUBTREECHECK 0x0400
+#define NFSEXP_ALLFLAGS 0x07FF
#endif /* _NSF_EXPORT_H */
diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index 21b85be..702df23 100644
--- a/support/nfs/exports.c
+++ b/support/nfs/exports.c
@@ -141,12 +141,16 @@ putexportent(struct exportent *ep)
fprintf(fp, "%ssync,", (ep->e_flags & NFSEXP_ASYNC)? "a" : "");
fprintf(fp, "%swdelay,", (ep->e_flags & NFSEXP_GATHERED_WRITES)?
"" : "no_");
+ fprintf(fp, "%shide,", (ep->e_flags & NFSEXP_CROSSMNT)?
+ "no" : "");
fprintf(fp, "%ssecure,", (ep->e_flags & NFSEXP_INSECURE_PORT)?
"in" : "");
fprintf(fp, "%sroot_squash,", (ep->e_flags & NFSEXP_ROOTSQUASH)?
"" : "no_");
fprintf(fp, "%sall_squash,", (ep->e_flags & NFSEXP_ALLSQUASH)?
"" : "no_");
+ fprintf(fp, "%ssubtree_check,", (ep->e_flags & NFSEXP_NOSUBTREECHECK)?
+ "no_" : "");
fprintf(fp, "mapping=");
switch (ep->e_maptype) {
@@ -281,6 +285,10 @@ parseopts(char *cp, struct exportent *ep)
ep->e_flags &= ~NFSEXP_ASYNC;
else if (!strcmp(opt, "async"))
ep->e_flags |= NFSEXP_ASYNC;
+ else if (!strcmp(opt, "nohide"))
+ ep->e_flags |= NFSEXP_CROSSMNT;
+ else if (!strcmp(opt, "hide"))
+ ep->e_flags &= ~NFSEXP_CROSSMNT;
else if (!strcmp(opt, "wdelay"))
ep->e_flags |= NFSEXP_GATHERED_WRITES;
else if (!strcmp(opt, "no_wdelay"))
@@ -293,6 +301,10 @@ parseopts(char *cp, struct exportent *ep)
ep->e_flags |= NFSEXP_ALLSQUASH;
else if (strcmp(opt, "no_all_squash") == 0)
ep->e_flags &= ~NFSEXP_ALLSQUASH;
+ else if (strcmp(opt, "subtree_check") == 0)
+ ep->e_flags &= ~NFSEXP_NOSUBTREECHECK;
+ else if (strcmp(opt, "no_subtree_check") == 0)
+ ep->e_flags |= NFSEXP_NOSUBTREECHECK;
else if (strncmp(opt, "mapping=", 8) == 0)
ep->e_maptype = parsemaptype(opt+8);
else if (strcmp(opt, "map_identity") == 0) /* old style */