diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2006-07-08 13:49:24 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2006-07-08 13:49:24 +0000 |
commit | 42f2307385b539be42db57548e392b25b20089d1 (patch) | |
tree | ecec46b0405f5724bdfa89b2c1e093f3ea67b69c /usr.sbin | |
parent | c46606bd75194eaed28ee3397a4cec4f1622854d (diff) | |
download | FreeBSD-src-42f2307385b539be42db57548e392b25b20089d1.zip FreeBSD-src-42f2307385b539be42db57548e392b25b20089d1.tar.gz |
In get_exportlist(), properly loop over mounted filesystems.
PR: bin/99873
Submitted by: Danny Braniss <danny at cs dot huji dot ac dot il>
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/mountd/mountd.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 7a1968f..40fb1c6 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -963,7 +963,7 @@ get_exportlist() struct export_args export; struct dirlist *dirhead; struct iovec *iov; - struct statfs fsb, *fsp; + struct statfs fsb, *fsp, *mntbufp; struct xucred anon; struct xvfsconf vfc; char *cp, *endcp, *dirp, *hst, *usr, *dom, savedc; @@ -1001,10 +1001,9 @@ get_exportlist() /* * And delete exports that are in the kernel for all local * filesystems. - * XXX: Should know how to handle all local exportable filesystems - * instead of just "ufs". + * XXX: Should know how to handle all local exportable filesystems. */ - num = getmntinfo(&fsp, MNT_NOWAIT); + num = getmntinfo(&mntbufp, MNT_NOWAIT); if (num > 0) { build_iovec(&iov, &iovlen, "fstype", NULL, 0); @@ -1016,6 +1015,7 @@ get_exportlist() } for (i = 0; i < num; i++) { + fsp = &mntbufp[i]; if (getvfsbyname(fsp->f_fstypename, &vfc) != 0) { syslog(LOG_ERR, "getvfsbyname() failed for %s", fsp->f_fstypename); @@ -1052,7 +1052,6 @@ get_exportlist() "can't delete exports for %s: %m %s", fsp->f_mntonname, errmsg); } - fsp++; } if (iov != NULL) { |