mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 02:12:45 +00:00
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,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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user