We probably shouldn't allow users to mount file systems with MNT_SUIDDIR.

There should be not shell access when SUIDDIR is compiled in, but
better be sure.

Reviewed by:	rwatson
This commit is contained in:
pjd 2004-03-26 21:12:14 +00:00
parent 11f479f519
commit b05f0288da

View File

@ -696,10 +696,12 @@ vfs_domount(
}
/*
* Silently enforce MNT_NOSUID, MNT_NODEV and MNT_USER
* for unprivileged users.
* for unprivileged users and remove MNT_SUIDDIR.
*/
if (suser(td))
if (suser(td)) {
fsflags &= ~MNT_SUIDDIR;
fsflags |= MNT_NOSUID | MNT_NODEV | MNT_USER;
}
/*
* Get vnode to be covered
*/