summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2006-06-06 21:56:49 +0000
committerrodrigc <rodrigc@FreeBSD.org>2006-06-06 21:56:49 +0000
commit88f89f303f98a490372396329e6e2b207a3a08d3 (patch)
tree38c455ffc80fe2cdc4d86478be26edce85672f38 /usr.sbin
parent13929c476aa373866fea214590fdd88b619e6337 (diff)
downloadFreeBSD-src-88f89f303f98a490372396329e6e2b207a3a08d3.zip
FreeBSD-src-88f89f303f98a490372396329e6e2b207a3a08d3.tar.gz
For network filesystems (NFS, samba, etc.), do not pass "export" nmount()
parameter to try to delete an NFS export. It won't work, and will log a spurious warning to syslog. Tested by: Arno J. Klaassen <arno at heho dot snv dot jussieu dot fr> MFC after: 3 days
Diffstat (limited to 'usr.sbin')
-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