- for(i=0;i<Node->NumACLs;i++)
- {
- if(!Node->ACLs[i].Inv) continue; // Ignore ALLOWs
- if(Node->ACLs[i].ID != 0x7FFFFFFF)
- {
- if(!Node->ACLs[i].Group && Node->ACLs[i].ID != uid) continue;
- if(Node->ACLs[i].Group && Node->ACLs[i].ID != gid) continue;
- }
-
- //Log("Deny %x", Node->ACLs[i].Perms);
-
- if(Node->ACLs[i].Perms & Permissions) {
- Log("VFS_CheckACL - %p inaccesable, %x denied",
- Node, Node->ACLs[i].Perms & Permissions);
- return 0;
- }
- }
-
- // Check for allow permissions
- for(i=0;i<Node->NumACLs;i++)
- {
- if(Node->ACLs[i].Inv) continue; // Ignore DENYs
- if(Node->ACLs[i].ID != 0x7FFFFFFF)
- {
- if(!Node->ACLs[i].Group && Node->ACLs[i].ID != uid) continue;
- if(Node->ACLs[i].Group && Node->ACLs[i].ID != gid) continue;
- }
-
- //Log("Allow %x", Node->ACLs[i].Perms);
-
- if((Node->ACLs[i].Perms & Permissions) == Permissions) return 1;
+ rv = VFS_int_CheckACLs(Node->ACLs, Node->NumACLs, 1, Permissions, uid, gid);
+ if( !rv )
+ Log("VFS_CheckACL - %p inaccesable, %x denied", Node, rv);
+ return 0;
+ rv = VFS_int_CheckACLs(Node->ACLs, Node->NumACLs, 0, Permissions, uid, gid);
+ if( !rv ) {
+ Log("VFS_CheckACL - %p inaccesable, %x not allowed", Node, rv);
+ return 0;