diff options
author | neilbrown <neilbrown> | 1999-10-28 02:27:55 +0000 |
---|---|---|
committer | neilbrown <neilbrown> | 1999-10-28 02:27:55 +0000 |
commit | acc4cade1891c0b07f3e0016ff3c5b604b042c86 (patch) | |
tree | c319d7d853e4466f465192afd5bfce4f9ffd9cfc /support | |
parent | 389610b2a817878802d25bd82919a79382b702ab (diff) | |
download | nfs-utils-acc4cade1891c0b07f3e0016ff3c5b604b042c86.tar.gz nfs-utils-acc4cade1891c0b07f3e0016ff3c5b604b042c86.tar.xz nfs-utils-acc4cade1891c0b07f3e0016ff3c5b604b042c86.zip |
Thu Oct 28 11:27:51 EST 1999 Neil Brown <neilb@cse.unsw.edu.au>
* support/include/nfs/export.h addedd NFSEXP_NOSUBTREECHECK
* support/nfs/exports.c: added {no_,}subtree_check and changed
crossmnt to nohide
* utils/exportfs/exports.man: added no_subtree_check and nohide
and removed irrelevant stuff from unfsd.
* support/export/rmtab.c: rmtab_read didn't quite do the right
thing if a pathname from rmtab was a subdirectory of an export-point
Diffstat (limited to 'support')
-rw-r--r-- | support/export/export.c | 4 | ||||
-rw-r--r-- | support/export/rmtab.c | 30 | ||||
-rw-r--r-- | support/include/nfs/export.h | 6 | ||||
-rw-r--r-- | support/nfs/exports.c | 12 |
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 */ |