diff options
author | mpp <mpp@FreeBSD.org> | 1996-03-11 20:01:17 +0000 |
---|---|---|
committer | mpp <mpp@FreeBSD.org> | 1996-03-11 20:01:17 +0000 |
commit | 2a7711493dce0c710afd9d8d1ad1fedda5cdad54 (patch) | |
tree | faeeb587c7f3fb2f5ebb335e6ce4037c01b688cd | |
parent | 433eb58b94db9d701eedb90c339b9be50f6b78fa (diff) | |
download | FreeBSD-src-2a7711493dce0c710afd9d8d1ad1fedda5cdad54.zip FreeBSD-src-2a7711493dce0c710afd9d8d1ad1fedda5cdad54.tar.gz |
Backout my changes to disallow "mount /mnt /mnt" until I can verify
that nfs mounts work again (I locked up my home machine testing it and can't
see what happened until I get home from work tonight).
-rw-r--r-- | sbin/mount/mount.c | 22 | ||||
-rw-r--r-- | sbin/mount_ifs/mount.c | 22 |
2 files changed, 0 insertions, 44 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index d5de560..1be00ec 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -262,7 +262,6 @@ mountfs(vfstype, spec, name, flags, options, mntopts) pid_t pid; int argc, i, status; char *optbuf, execname[MAXPATHLEN + 1], mntpath[MAXPATHLEN]; - char specpath[MAXPATHLEN]; if (realpath(name, mntpath) != NULL && stat(mntpath, &sb) == 0) { if (!S_ISDIR(sb.st_mode)) { @@ -274,27 +273,6 @@ mountfs(vfstype, spec, name, flags, options, mntopts) return (1); } - /* - * The following check is a kludge to prevent the caller from - * accidently using the file as the special device file and - * the mount point. This will cause a panic due to a recursive - * vnode lock. After some of the planned reworking of the - * file system code is done, the kernel can be fixed properly - * and this stupid check can be removed. - */ - if (realpath(spec, specpath) == NULL) { - warn("%s", specpath); - return (1); - } - if (strcmp(vfstype, "ufs") == 0 || strcmp(vfstype, "msdos") == 0 || - strcmp(vfstype, "cd9660") == 0) { - if (strcmp(mntpath, specpath) == 0) { - warnx("%s: Special device file and mount point may not be the same", - specpath); - return (1); - } - } - if (mntopts == NULL) mntopts = ""; diff --git a/sbin/mount_ifs/mount.c b/sbin/mount_ifs/mount.c index d5de560..1be00ec 100644 --- a/sbin/mount_ifs/mount.c +++ b/sbin/mount_ifs/mount.c @@ -262,7 +262,6 @@ mountfs(vfstype, spec, name, flags, options, mntopts) pid_t pid; int argc, i, status; char *optbuf, execname[MAXPATHLEN + 1], mntpath[MAXPATHLEN]; - char specpath[MAXPATHLEN]; if (realpath(name, mntpath) != NULL && stat(mntpath, &sb) == 0) { if (!S_ISDIR(sb.st_mode)) { @@ -274,27 +273,6 @@ mountfs(vfstype, spec, name, flags, options, mntopts) return (1); } - /* - * The following check is a kludge to prevent the caller from - * accidently using the file as the special device file and - * the mount point. This will cause a panic due to a recursive - * vnode lock. After some of the planned reworking of the - * file system code is done, the kernel can be fixed properly - * and this stupid check can be removed. - */ - if (realpath(spec, specpath) == NULL) { - warn("%s", specpath); - return (1); - } - if (strcmp(vfstype, "ufs") == 0 || strcmp(vfstype, "msdos") == 0 || - strcmp(vfstype, "cd9660") == 0) { - if (strcmp(mntpath, specpath) == 0) { - warnx("%s: Special device file and mount point may not be the same", - specpath); - return (1); - } - } - if (mntopts == NULL) mntopts = ""; |