only do name lookup for nfs filesystems
authorJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Fri, 3 Feb 1995 22:25:51 +0000 (14:25 -0800)
committerJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Fri, 3 Feb 1995 22:25:51 +0000 (14:25 -0800)
SCCS-vsn: sbin/umount/umount.c 8.6
SCCS-vsn: sbin/umount/umount.c 8.6

usr/src/sbin/umount/umount.c

index 2c3b0ad..25b7eb2 100644 (file)
@@ -12,7 +12,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #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 <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -193,19 +193,22 @@ umountfs(name)
        if (!selected(type))
                return (1);
 
        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);
 
        if (!namematch(hp))
                return (1);