summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2002-08-01 20:44:52 +0000
committerRobert Watson <rwatson@FreeBSD.org>2002-08-01 20:44:52 +0000
commit18b770b2fba7f08e46e1de8eaffb47a927643229 (patch)
treeef06ad305049de06727bc367da2f41c299735c86 /sys/kern/vfs_syscalls.c
parent67759b33f69db0ac54fac81e5cc6a4f8b0d83712 (diff)
downloadsrc-test2-18b770b2fba7f08e46e1de8eaffb47a927643229.tar.gz
src-test2-18b770b2fba7f08e46e1de8eaffb47a927643229.zip
Notes
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index a38fa6a589f6..f02f62f6ae14 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -2865,6 +2865,14 @@ unionread:
auio.uio_resid = SCARG(uap, count);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
loff = auio.uio_offset = fp->f_offset;
+#ifdef MAC
+ error = mac_check_vnode_readdir(td->td_ucred, vp);
+ if (error) {
+ VOP_UNLOCK(vp, 0, td);
+ fdrop(fp, td);
+ return (error);
+ }
+#endif
# if (BYTE_ORDER != LITTLE_ENDIAN)
if (vp->v_mount->mnt_maxsymlinklen <= 0) {
error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag,
@@ -3000,7 +3008,12 @@ unionread:
/* vn_lock(vp, LK_SHARED | LK_RETRY, td); */
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
loff = auio.uio_offset = fp->f_offset;
- error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, NULL, NULL);
+#ifdef MAC
+ error = mac_check_vnode_readdir(td->td_ucred, vp);
+ if (error == 0)
+#endif
+ error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, NULL,
+ NULL);
fp->f_offset = auio.uio_offset;
VOP_UNLOCK(vp, 0, td);
if (error) {