diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-08-01 22:23:02 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-08-01 22:23:02 +0000 |
commit | b246ee0a3cced8c39f5aaa8505242e775d93e8c4 (patch) | |
tree | 1b32476766408c94dcee10b7fe67f140d5da3e23 /sys/compat/linux/linux_getcwd.c | |
parent | 41f4dc56d14bda3dbbebfdb61740397a2caf7321 (diff) | |
download | FreeBSD-src-b246ee0a3cced8c39f5aaa8505242e775d93e8c4.zip FreeBSD-src-b246ee0a3cced8c39f5aaa8505242e775d93e8c4.tar.gz |
Introduce support for Mandatory Access Control and extensible
kernel access control.
Invoke appropriate MAC entry points for a number of VFS-related
operations in the Linux ABI module. In particular, handle uselib
in a manner similar to open() (more work is probably needed here),
as well as handle statfs(), and linux readdir()-like calls.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'sys/compat/linux/linux_getcwd.c')
-rw-r--r-- | sys/compat/linux/linux_getcwd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_getcwd.c b/sys/compat/linux/linux_getcwd.c index 6e8d0b1..44079b9 100644 --- a/sys/compat/linux/linux_getcwd.c +++ b/sys/compat/linux/linux_getcwd.c @@ -38,6 +38,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "opt_compat.h" +#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> @@ -51,6 +52,7 @@ #include <sys/mount.h> #include <sys/proc.h> #include <sys/uio.h> +#include <sys/mac.h> #include <sys/malloc.h> #include <sys/dirent.h> #include <ufs/ufs/dir.h> /* XXX only for DIRBLKSIZ */ @@ -200,7 +202,12 @@ unionread: eofflag = 0; - error = VOP_READDIR(uvp, &uio, td->td_ucred, &eofflag, 0, 0); +#ifdef MAC + error = mac_check_vnode_readdir(td->td_ucred, uvp); + if (error == 0) +#endif /* MAC */ + error = VOP_READDIR(uvp, &uio, td->td_ucred, &eofflag, + 0, 0); off = uio.uio_offset; |