Index: vfs_mount.c =================================================================== RCS file: /private/FreeBSD/src/sys/kern/vfs_mount.c,v retrieving revision 1.117 diff -u -r1.117 vfs_mount.c --- vfs_mount.c 30 Nov 2003 23:30:09 -0000 1.117 +++ vfs_mount.c 2 Feb 2004 18:01:58 -0000 @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -678,6 +679,10 @@ if (strlen(fstype) >= MFSNAMELEN || strlen(fspath) >= MNAMELEN) return (ENAMETOOLONG); + /* mount(2) is not permitted inside the jail. */ + if (jailed(td->td_ucred)) + return (EPERM); + if (usermount == 0) { error = suser(td); if (error) @@ -1013,6 +1018,15 @@ struct mount *mp; char *pathbuf; int error, id0, id1; + + /* unmount(2) is not permitted inside the jail. */ + if (jailed(td->td_ucred)) + return (EPERM); + + if (usermount == 0) { + if ((error = suser(td)) != 0) + return (error); + } pathbuf = malloc(MNAMELEN, M_TEMP, M_WAITOK); error = copyinstr(uap->path, pathbuf, MNAMELEN, NULL);