apply realpath() to the mountpoint
authorJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Thu, 17 Feb 1994 23:22:45 +0000 (15:22 -0800)
committerJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Thu, 17 Feb 1994 23:22:45 +0000 (15:22 -0800)
SCCS-vsn: sbin/mount/mount.c 8.9

usr/src/sbin/mount/mount.c

index 96c1dda..0b92ef7 100644 (file)
@@ -12,7 +12,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)mount.c    8.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)mount.c    8.9 (Berkeley) %G%";
 #endif /* not lint */
 
 
 #endif /* not lint */
 
 
@@ -231,6 +231,7 @@ mountfs(spec, name, flags, type, options, mntopts)
        struct ufs_args args;
        char *argp, *argv[50];
        char execname[MAXPATHLEN + 1], flagval[12];
        struct ufs_args args;
        char *argp, *argv[50];
        char execname[MAXPATHLEN + 1], flagval[12];
+       char mntpath[MAXPATHLEN];
 
        if (mntopts)
                getstdopts(mntopts, &flags);
 
        if (mntopts)
                getstdopts(mntopts, &flags);
@@ -240,6 +241,14 @@ mountfs(spec, name, flags, type, options, mntopts)
                getstdopts(type, &flags);
        if (force)
                flags |= MNT_FORCE;
                getstdopts(type, &flags);
        if (force)
                flags |= MNT_FORCE;
+
+       if (realpath(name, mntpath) == 0) {
+               warn("%s", mntpath);
+               return (1);
+       }
+
+       name = mntpath;
+
        if (strcmp(name, "/") == 0)
                flags |= MNT_UPDATE;
 
        if (strcmp(name, "/") == 0)
                flags |= MNT_UPDATE;