Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38396
b: refs/heads/master
c: b548edc
h: refs/heads/master
v: v3
  • Loading branch information
J.Bruce Fields authored and Linus Torvalds committed Oct 4, 2006
1 parent 3cbc8bd commit 0b15384
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 09229edb68a3961db54174a2725055bd1589b4b8
refs/heads/master: b548edc2dd9440c561f3302cb9f212ef2d06a8ef
43 changes: 30 additions & 13 deletions trunk/fs/nfsd/nfs4acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
#define NFS4_INHERITANCE_FLAGS (NFS4_ACE_FILE_INHERIT_ACE \
| NFS4_ACE_DIRECTORY_INHERIT_ACE | NFS4_ACE_INHERIT_ONLY_ACE)

#define NFS4_SUPPORTED_FLAGS (NFS4_INHERITANCE_FLAGS | NFS4_ACE_IDENTIFIER_GROUP)

#define MASK_EQUAL(mask1, mask2) \
( ((mask1) & NFS4_ACE_MASK_ALL) == ((mask2) & NFS4_ACE_MASK_ALL) )

Expand Down Expand Up @@ -721,22 +723,37 @@ nfs4_acl_split(struct nfs4_acl *acl, struct nfs4_acl *dacl)
ace->type != NFS4_ACE_ACCESS_DENIED_ACE_TYPE)
return -EINVAL;

if ((ace->flag & NFS4_INHERITANCE_FLAGS)
!= NFS4_INHERITANCE_FLAGS)
continue;
if (ace->flag & ~NFS4_SUPPORTED_FLAGS)
return -EINVAL;

error = nfs4_acl_add_ace(dacl, ace->type, ace->flag,
switch (ace->flag & NFS4_INHERITANCE_FLAGS) {
case 0:
/* Leave this ace in the effective acl: */
continue;
case NFS4_INHERITANCE_FLAGS:
/* Add this ace to the default acl and remove it
* from the effective acl: */
error = nfs4_acl_add_ace(dacl, ace->type, ace->flag,
ace->access_mask, ace->whotype, ace->who);
if (error < 0)
goto out;

list_del(h);
kfree(ace);
acl->naces--;
if (error)
return error;
list_del(h);
kfree(ace);
acl->naces--;
break;
case NFS4_INHERITANCE_FLAGS & ~NFS4_ACE_INHERIT_ONLY_ACE:
/* Add this ace to the default, but leave it in
* the effective acl as well: */
error = nfs4_acl_add_ace(dacl, ace->type, ace->flag,
ace->access_mask, ace->whotype, ace->who);
if (error)
return error;
break;
default:
return -EINVAL;
}
}

out:
return error;
return 0;
}

static short
Expand Down

0 comments on commit 0b15384

Please sign in to comment.