diff --git a/usr.sbin/rpc.umntall/rpc.umntall.8 b/usr.sbin/rpc.umntall/rpc.umntall.8 index 2fafe30f623b..a202b6c94af0 100644 --- a/usr.sbin/rpc.umntall/rpc.umntall.8 +++ b/usr.sbin/rpc.umntall/rpc.umntall.8 @@ -81,7 +81,7 @@ Keep entries for existing NFS filesystems. Compare the NFS filesystems from the mounttab against the kernel mountlist and do not send the RPC to existing mount entries. Useful during startup of the system. It may be possible that there are already mounted NFS filesystems, so calling -RPC UMNTALL isn't a good idea. This is the case if the user has rebooted +RPC UMOUNT isn't a good idea. This is the case if the user has rebooted to 'single user mode' and starts up the system again. .It Fl p Ar path Only remove the specific mount-path. Send a UMOUNT RPC to the NFS server. diff --git a/usr.sbin/rpc.umntall/rpc.umntall.c b/usr.sbin/rpc.umntall/rpc.umntall.c index 9d1dbecc804d..11f07ec7aeff 100644 --- a/usr.sbin/rpc.umntall/rpc.umntall.c +++ b/usr.sbin/rpc.umntall/rpc.umntall.c @@ -110,9 +110,8 @@ main(int argc, char **argv) { PATH_MOUNTTAB); } for (mtab = mtabhead; mtab != NULL; mtab = mtab->mtab_next) { - if (*mtab->mtab_host != '\0' && - (do_umntall(mtab->mtab_host) || - mtab->mtab_time <= (time(now) - expire))) { + if (*mtab->mtab_host != '\0' || + mtab->mtab_time <= (time(now) - expire)) { if (keep && is_mounted(mtab->mtab_host, mtab->mtab_dirp)) { if (verbose) { @@ -120,8 +119,11 @@ main(int argc, char **argv) { mtab->mtab_host, mtab->mtab_dirp); } - } else - clean_mtab(mtab->mtab_host, NULL); + } else if (do_umount(mtab->mtab_host, + mtab->mtab_dirp)) { + clean_mtab(mtab->mtab_host, + mtab->mtab_dirp); + } } } /* Only do a RPC UMNTALL for this specific host */ @@ -162,6 +164,8 @@ main(int argc, char **argv) { /* * Send a RPC_MNT UMNTALL request to hostname. + * XXX This works for all mountd implementations, + * but produces a RPC IOERR on non FreeBSD systems. */ int do_umntall(char *hostname) {