Refuse attempts to mount root filesystem
This commit is contained in:
parent
b0aed5267e
commit
64042a76b6
@ -85,6 +85,8 @@ nullfs_mount(struct mount *mp, struct thread *td)
|
||||
|
||||
NULLFSDEBUG("nullfs_mount(mp = %p)\n", (void *)mp);
|
||||
|
||||
if (mp->mnt_flag & MNT_ROOTFS)
|
||||
return (EOPNOTSUPP);
|
||||
/*
|
||||
* Update is a no-op
|
||||
*/
|
||||
|
@ -147,6 +147,8 @@ static int nwfs_omount(struct mount *mp, char *path, caddr_t data,
|
||||
struct vnode *vp;
|
||||
char *pc,*pe;
|
||||
|
||||
if (mp->mnt_flag & MNT_ROOTFS)
|
||||
return (EOPNOTSUPP);
|
||||
if (data == NULL) {
|
||||
nwfs_printf("missing data argument\n");
|
||||
return 1;
|
||||
|
@ -85,7 +85,7 @@ portal_omount(mp, path, data, td)
|
||||
/*
|
||||
* Update is a no-op
|
||||
*/
|
||||
if (mp->mnt_flag & MNT_UPDATE)
|
||||
if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS))
|
||||
return (EOPNOTSUPP);
|
||||
|
||||
error = copyin(data, (caddr_t) &args, sizeof(struct portal_args));
|
||||
|
@ -122,10 +122,9 @@ smbfs_omount(struct mount *mp, char *path, caddr_t data, struct thread *td)
|
||||
printf("missing data argument\n");
|
||||
return EINVAL;
|
||||
}
|
||||
if (mp->mnt_flag & MNT_UPDATE) {
|
||||
printf("MNT_UPDATE not implemented");
|
||||
if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS))
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
|
||||
error = copyin(data, (caddr_t)&args, sizeof(struct smbfs_args));
|
||||
if (error)
|
||||
return error;
|
||||
|
@ -99,7 +99,7 @@ umapfs_omount(mp, path, data, ndp, td)
|
||||
/*
|
||||
* Update is a no-op
|
||||
*/
|
||||
if (mp->mnt_flag & MNT_UPDATE) {
|
||||
if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) {
|
||||
return (EOPNOTSUPP);
|
||||
/* return (VFS_MOUNT(MOUNTTOUMAPMOUNT(mp)->umapm_vfs, path, data, ndp, td));*/
|
||||
}
|
||||
|
@ -89,6 +89,8 @@ union_mount(mp, td)
|
||||
*/
|
||||
mp->mnt_flag |= MNT_NOCLUSTERW;
|
||||
|
||||
if (mp->mnt_flag & MNT_ROOTFS)
|
||||
return (EOPNOTSUPP);
|
||||
/*
|
||||
* Update is a no-op
|
||||
*/
|
||||
|
@ -393,7 +393,7 @@ nfs_omount(struct mount *mp, char *path, caddr_t data, struct thread *td)
|
||||
char hst[MNAMELEN];
|
||||
size_t len;
|
||||
|
||||
if (path == NULL) {
|
||||
if (mp->mnt_flag & MNT_ROOTFS) {
|
||||
printf("NFSv4: nfs_mountroot not supported\n");
|
||||
return EINVAL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user