diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2006-05-24 11:49:39 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2006-05-24 11:49:39 +0000 |
commit | 155325e141d52dfb9b4691302e725f29770b3775 (patch) | |
tree | 657209cc3c81639979e100690f1a353bb1502c12 /usr.sbin | |
parent | bcebd3658fd207a3b72f05f195da2c5c05586733 (diff) | |
download | FreeBSD-src-155325e141d52dfb9b4691302e725f29770b3775.zip FreeBSD-src-155325e141d52dfb9b4691302e725f29770b3775.tar.gz |
Convert to nmount() and remove hardcoded checks for ufs, msdosfs, ntfs,
and cd9660.
PR: bin/97642
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/mountd/mountd.c | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index dbc7cee..b44a1fc 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -1015,33 +1015,27 @@ get_exportlist() } for (i = 0; i < num; i++) { + iov[1].iov_base = fsp->f_fstypename; + iov[1].iov_len = strlen(fsp->f_fstypename) + 1; + iov[3].iov_base = fsp->f_mntonname; + iov[3].iov_len = strlen(fsp->f_mntonname) + 1; + iov[5].iov_base = fsp->f_mntfromname; + iov[5].iov_len = strlen(fsp->f_mntfromname) + 1; - if (!strcmp(fsp->f_fstypename, "ufs") || - !strcmp(fsp->f_fstypename, "msdosfs") || - !strcmp(fsp->f_fstypename, "ntfs") || - !strcmp(fsp->f_fstypename, "cd9660")) { - iov[1].iov_base = fsp->f_fstypename; - iov[1].iov_len = strlen(fsp->f_fstypename) + 1; - iov[3].iov_base = fsp->f_mntonname; - iov[3].iov_len = strlen(fsp->f_mntonname) + 1; - iov[5].iov_base = fsp->f_mntfromname; - iov[5].iov_len = strlen(fsp->f_mntfromname) + 1; - - /* - * Kick out MNT_ROOTFS. It should not be passed from - * userland to kernel. It should only be used - * internally in the kernel. - */ - if (fsp->f_flags & MNT_ROOTFS) { - fsp->f_flags &= ~MNT_ROOTFS; - } + /* + * Kick out MNT_ROOTFS. It should not be passed from + * userland to kernel. It should only be used + * internally in the kernel. + */ + if (fsp->f_flags & MNT_ROOTFS) { + fsp->f_flags &= ~MNT_ROOTFS; + } - if (nmount(iov, iovlen, fsp->f_flags) < 0 && - errno != ENOENT) { - syslog(LOG_ERR, - "can't delete exports for %s: %m %s", - fsp->f_mntonname, errmsg); - } + if (nmount(iov, iovlen, fsp->f_flags) < 0 && + errno != ENOENT) { + syslog(LOG_ERR, + "can't delete exports for %s: %m %s", + fsp->f_mntonname, errmsg); } fsp++; } |