Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9717
b: refs/heads/master
c: 7ab501d
h: refs/heads/master
i:
  9715: 9a694fd
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Oct 8, 2005
1 parent 31f8925 commit 2cebfe5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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: 468ed2b0c85ec4310b429e60358213b6d077289e
refs/heads/master: 7ab501db8cb6659efdf04034e0de6b44c059a51b
12 changes: 6 additions & 6 deletions trunk/security/keys/permission.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ int key_task_permission(const key_ref_t key_ref,

key = key_ref_to_ptr(key_ref);

/* use the top 8-bits of permissions for keys the caller possesses */
if (is_key_possessed(key_ref)) {
kperm = key->perm >> 24;
goto use_these_perms;
}

/* use the second 8-bits of permissions for keys the caller owns */
if (key->uid == context->fsuid) {
kperm = key->perm >> 16;
Expand Down Expand Up @@ -61,6 +55,12 @@ int key_task_permission(const key_ref_t key_ref,
kperm = key->perm;

use_these_perms:
/* use the top 8-bits of permissions for keys the caller possesses
* - possessor permissions are additive with other permissions
*/
if (is_key_possessed(key_ref))
kperm |= key->perm >> 24;

kperm = kperm & perm & KEY_ALL;

return kperm == perm;
Expand Down

0 comments on commit 2cebfe5

Please sign in to comment.