From 746aab982ae3b7b6e1fb8109e5e9892a1821d6ec Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 27 Nov 2007 20:01:00 +0000 Subject: [PATCH] macos-no-read-on-directories-20071127 thanks to quentin@mit.edu for pointing this out. no read() on directories --- src/afs/DARWIN/osi_vnodeops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index 467570e51c..ba7197f0e8 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -743,6 +743,9 @@ afs_vop_read(ap) int code; struct vnode *vp = ap->a_vp; struct vcache *avc = VTOAFS(vp); + + if (vnode_isdir(ap->a_vp)) + return EISDIR; #ifdef AFS_DARWIN80_ENV ubc_sync_range(ap->a_vp, AFS_UIO_OFFSET(ap->a_uio), AFS_UIO_OFFSET(ap->a_uio) + AFS_UIO_RESID(ap->a_uio), UBC_PUSHDIRTY); #else