From 24c290cf29a0fe6c3b8ee988879bd44c7fd80a6e Mon Sep 17 00:00:00 2001 From: Jan-Simon Pendry Date: Fri, 3 Feb 1995 14:25:51 -0800 Subject: [PATCH] only do name lookup for nfs filesystems SCCS-vsn: sbin/umount/umount.c 8.6 SCCS-vsn: sbin/umount/umount.c 8.6 --- usr/src/sbin/umount/umount.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) 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); -- 2.20.1