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:
parent
250c11f9c3
commit
bd70de3eaf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14474
@ -286,11 +286,14 @@ mountfs(vfstype, spec, name, flags, options, mntopts)
|
||||
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 = "";
|
||||
|
@ -286,11 +286,14 @@ mountfs(vfstype, spec, name, flags, options, mntopts)
|
||||
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 = "";
|
||||
|
Loading…
Reference in New Issue
Block a user