summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mountd/mountd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/mountd/mountd.c')
-rw-r--r--usr.sbin/mountd/mountd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index 350e888..7a1968f 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -965,6 +965,7 @@ get_exportlist()
struct iovec *iov;
struct statfs fsb, *fsp;
struct xucred anon;
+ struct xvfsconf vfc;
char *cp, *endcp, *dirp, *hst, *usr, *dom, savedc;
char errmsg[255];
int len, has_host, exflags, got_nondir, dirplen, num, i, netgrp;
@@ -1015,6 +1016,20 @@ get_exportlist()
}
for (i = 0; i < num; i++) {
+ if (getvfsbyname(fsp->f_fstypename, &vfc) != 0) {
+ syslog(LOG_ERR, "getvfsbyname() failed for %s",
+ fsp->f_fstypename);
+ continue;
+ }
+
+ /*
+ * Do not delete export for network filesystem by
+ * passing "export" arg to nmount().
+ * It only makes sense to do this for local filesystems.
+ */
+ if (vfc.vfc_flags & VFCF_NETWORK)
+ continue;
+
iov[1].iov_base = fsp->f_fstypename;
iov[1].iov_len = strlen(fsp->f_fstypename) + 1;
iov[3].iov_base = fsp->f_mntonname;
OpenPOWER on IntegriCloud