aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount
diff options
context:
space:
mode:
authorMike Pritchard <mpp@FreeBSD.org>1996-03-11 00:22:28 +0000
committerMike Pritchard <mpp@FreeBSD.org>1996-03-11 00:22:28 +0000
commitbd70de3eaf4d858ab74698088ee9ab1b765906e9 (patch)
tree2e35a33a0980d1a2d882548ea3cc941abab0620c /sbin/mount
parent250c11f9c33e8aa5eaee4fd52092174ce9f414ed (diff)
downloadsrc-bd70de3eaf4d858ab74698088ee9ab1b765906e9.tar.gz
src-bd70de3eaf4d858ab74698088ee9ab1b765906e9.zip
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.
Notes
Notes: svn path=/head/; revision=14474
Diffstat (limited to 'sbin/mount')
-rw-r--r--sbin/mount/mount.c11
1 files changed, 7 insertions, 4 deletions
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)