DragonFly BSD
DragonFly kernel List (threaded) for 2004-12
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

naccess and AFS


From: Richard Nyberg <rnyberg@xxxxxxxx>
Date: Tue, 07 Dec 2004 23:19:42 +0100

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);




[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]