Only restrict the user from doing something like "mount /mnt /mnt"

for file system types that actually cause a panic (ufs, msdos, cd9660).
This makes /proc mountable again.
This commit is contained in:
Mike Pritchard 1996-03-11 00:22:28 +00:00
parent 250c11f9c3
commit bd70de3eaf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14474
2 changed files with 14 additions and 8 deletions

View File

@ -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)

View File

@ -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)