diff options
author | mpp <mpp@FreeBSD.org> | 1996-03-11 00:22:28 +0000 |
---|---|---|
committer | mpp <mpp@FreeBSD.org> | 1996-03-11 00:22:28 +0000 |
commit | 601423787031d713035425267f1d3052f6f6292c (patch) | |
tree | 2e35a33a0980d1a2d882548ea3cc941abab0620c /sbin | |
parent | c2c92de148b011da2a37e1676f3dbf8aaa02722f (diff) | |
download | FreeBSD-src-601423787031d713035425267f1d3052f6f6292c.zip FreeBSD-src-601423787031d713035425267f1d3052f6f6292c.tar.gz |
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.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/mount/mount.c | 11 | ||||
-rw-r--r-- | sbin/mount_ifs/mount.c | 11 |
2 files changed, 14 insertions, 8 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 075ffcf..d5de560 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 075ffcf..d5de560 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) |