summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.umntall/rpc.umntall.c
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/rpc.umntall.c
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/rpc.umntall.c')
-rw-r--r--usr.sbin/rpc.umntall/rpc.umntall.c14
1 files changed, 9 insertions, 5 deletions
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