summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.umntall
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>1999-12-08 22:29:30 +0000
committergrog <grog@FreeBSD.org>1999-12-08 22:29:30 +0000
commitfd1d27ccf871f76daebc50eb43e9a8c911493119 (patch)
tree6123d4e34c35e60cff3cb64f9acd4fd2410f2110 /usr.sbin/rpc.umntall
parent417fa30de618234ab56569f76161137a2931e717 (diff)
downloadFreeBSD-src-fd1d27ccf871f76daebc50eb43e9a8c911493119.zip
FreeBSD-src-fd1d27ccf871f76daebc50eb43e9a8c911493119.tar.gz
Fix errors unmounting remote systems which don't understand RPC_UMNTALL.
Submitted by: Martin Blapp <mblapp@kassiopeja.lan.attic.ch>
Diffstat (limited to 'usr.sbin/rpc.umntall')
-rw-r--r--usr.sbin/rpc.umntall/rpc.umntall.82
-rw-r--r--usr.sbin/rpc.umntall/rpc.umntall.c14
2 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/rpc.umntall/rpc.umntall.8 b/usr.sbin/rpc.umntall/rpc.umntall.8
index 2fafe30..a202b6c 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 9d1dbec..11f07ec 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) {
OpenPOWER on IntegriCloud