From: Jan-Simon Pendry Date: Fri, 3 Feb 1995 22:25:51 +0000 (-0800) Subject: only do name lookup for nfs filesystems X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/24c290cf29a0fe6c3b8ee988879bd44c7fd80a6e only do name lookup for nfs filesystems SCCS-vsn: sbin/umount/umount.c 8.6 SCCS-vsn: sbin/umount/umount.c 8.6 --- diff --git a/usr/src/sbin/umount/umount.c b/usr/src/sbin/umount/umount.c index 2c3b0aded7..25b7eb267e 100644 --- a/usr/src/sbin/umount/umount.c +++ b/usr/src/sbin/umount/umount.c @@ -12,7 +12,7 @@ static char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)umount.c 8.5 (Berkeley) %G%"; +static char sccsid[] = "@(#)umount.c 8.6 (Berkeley) %G%"; #endif /* not lint */ #include @@ -193,19 +193,22 @@ umountfs(name) if (!selected(type)) return (1); - if ((delimp = strchr(name, '@')) != NULL) { - hostp = delimp + 1; - *delimp = '\0'; - hp = gethostbyname(hostp); - *delimp = '@'; - } else if ((delimp = strchr(name, ':')) != NULL) { - *delimp = '\0'; - hostp = name; - hp = gethostbyname(hostp); - name = delimp + 1; - *delimp = ':'; - } else - hp = NULL; + hp = NULL; + if (type == MOUNT_NFS) { + if ((delimp = strchr(name, '@')) != NULL) { + hostp = delimp + 1; + *delimp = '\0'; + hp = gethostbyname(hostp); + *delimp = '@'; + } else if ((delimp = strchr(name, ':')) != NULL) { + *delimp = '\0'; + hostp = name; + hp = gethostbyname(hostp); + name = delimp + 1; + *delimp = ':'; + } + } + if (!namematch(hp)) return (1);