aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/mountd
diff options
context:
space:
mode:
authorCraig Rodrigues <rodrigc@FreeBSD.org>2006-06-06 21:56:49 +0000
committerCraig Rodrigues <rodrigc@FreeBSD.org>2006-06-06 21:56:49 +0000
commita84ee0d367f6d0f1723883cd01a93741ae9bc655 (patch)
tree38c455ffc80fe2cdc4d86478be26edce85672f38 /usr.sbin/mountd
parentd661dc80703d01b7d733bf9cae14a0535557c5a2 (diff)
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
Notes
Notes: svn path=/head/; revision=159360
Diffstat (limited to 'usr.sbin/mountd')
-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 350e888859cd..7a1968f7d392 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;