diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 075ffcf943d6..d5de5601feeb 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -286,10 +286,13 @@ mountfs(vfstype, spec, name, flags, options, mntopts) warn("%s", specpath); return (1); } - if (strcmp(mntpath, specpath) == 0) { - warnx("%s: Special device file and mount point may not be the same", - 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) diff --git a/sbin/mount_ifs/mount.c b/sbin/mount_ifs/mount.c index 075ffcf943d6..d5de5601feeb 100644 --- a/sbin/mount_ifs/mount.c +++ b/sbin/mount_ifs/mount.c @@ -286,10 +286,13 @@ mountfs(vfstype, spec, name, flags, options, mntopts) warn("%s", specpath); return (1); } - if (strcmp(mntpath, specpath) == 0) { - warnx("%s: Special device file and mount point may not be the same", - 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)