[BACK]Return to hfs_vnops.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / fs / hfs

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/fs/hfs/hfs_vnops.c between version 1.13 and 1.13.2.1

version 1.13, 2008/12/17 20:51:35 version 1.13.2.1, 2009/07/23 23:32:32
Line 517  hfs_vop_close(void *v)
Line 517  hfs_vop_close(void *v)
         return 0;          return 0;
 }  }
   
 int  static int
 hfs_vop_access(void *v)  hfs_check_possible(struct vnode *vp, mode_t mode)
 {  {
         struct vop_access_args /* {  
                 struct vnode *a_vp;  
                 int a_mode;  
                 kauth_cred_t a_cred;  
         } */ *ap = v;  
         struct vattr va;  
         int error;  
   
 #ifdef HFS_DEBUG  
         printf("VOP = hfs_vop_access()\n");  
 #endif /* HFS_DEBUG */  
   
         /*          /*
          * Disallow writes on files, directories, and symlinks           * Disallow writes on files, directories, and symlinks
          * since we have no write support yet.           * since we have no write support yet.
          */           */
   
         if (ap->a_mode & VWRITE) {          if (mode & VWRITE) {
                 switch (ap->a_vp->v_type) {                  switch (vp->v_type) {
                 case VDIR:                  case VDIR:
                 case VLNK:                  case VLNK:
                 case VREG:                  case VREG:
Line 548  hfs_vop_access(void *v)
Line 537  hfs_vop_access(void *v)
                 }                  }
         }          }
   
           return 0;
   }
   
   static int
   hfs_check_permitted(struct vattr *va, mode_t mode, kauth_cred_t cred)
   {
   
           return genfs_can_access(va->va_type, va->va_mode, va->va_uid,
               va->va_gid, mode, cred);
   }
   
   int
   hfs_vop_access(void *v)
   {
           struct vop_access_args /* {
                   struct vnode *a_vp;
                   int a_mode;
                   kauth_cred_t a_cred;
           } */ *ap = v;
           struct vattr va;
           int error;
   
   #ifdef HFS_DEBUG
           printf("VOP = hfs_vop_access()\n");
   #endif /* HFS_DEBUG */
   
           error = hfs_check_possible(ap->a_vp, ap->a_mode);
           if (error)
                   return error;
   
         if ((error = VOP_GETATTR(ap->a_vp, &va, ap->a_cred)) != 0)          if ((error = VOP_GETATTR(ap->a_vp, &va, ap->a_cred)) != 0)
                 return error;                  return error;
   
         return vaccess(va.va_type, va.va_mode, va.va_uid, va.va_gid,          error = hfs_check_permitted(&va, ap->a_mode, ap->a_cred);
             ap->a_mode, ap->a_cred);  
           return error;
 }  }
   
 int  int

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.13.2.1

CVSweb <webmaster@jp.NetBSD.org>