naccess and AFS
Richard Nyberg
rnyberg at it.su.se
Tue Dec 7 14:19:42 PST 2004
Hello Matt!
AFS uses acl:s to determine who can do what in a directory.
Unfortunately naccess assusmes it can determine this from
the unix user, group and mode information.
Below is a patch that works for me...
-Richard
Index: vfs_nlookup.c
===================================================================
RCS file: /home/dcvs/src/sys/kern/vfs_nlookup.c,v
retrieving revision 1.8
diff -u -r1.8 vfs_nlookup.c
--- vfs_nlookup.c 18 Nov 2004 20:04:24 -0000 1.8
+++ vfs_nlookup.c 7 Dec 2004 22:04:18 -0000
@@ -682,7 +682,6 @@
{
struct namecache *par;
struct vnode *vp;
- struct vattr va;
int error;
if (ncp->nc_flag & NCF_UNRESOLVED) {
@@ -713,16 +712,13 @@
if (vmode & VCREATE)
error = 0;
} else if (error == 0) {
- /* XXX cache the va in the namecache or in the vnode */
- if ((error = VOP_GETATTR(vp, &va, curthread)) == 0) {
- if ((vmode & VWRITE) && vp->v_mount) {
- if (vp->v_mount->mnt_flag & MNT_RDONLY)
- error = EROFS;
- }
+ if ((vmode & VWRITE) && vp->v_mount) {
+ if (vp->v_mount->mnt_flag & MNT_RDONLY)
+ error = EROFS;
}
- vput(vp);
if (error == 0)
- error = naccess_va(&va, vmode, cred);
+ error = VOP_ACCESS(vp, vmode, cred, curthread);
+ vput(vp);
}
}
return(error);
More information about the Kernel
mailing list