Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132637
b: refs/heads/master
c: 8ff3bc3
h: refs/heads/master
i:
  132635: 38c432f
v: v3
  • Loading branch information
Serge E. Hallyn authored and James Morris committed Feb 27, 2009
1 parent d0fb2b2 commit 01fdc78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d1e97562e5e2ac60fb7b25437ba619f95f67fab
refs/heads/master: 8ff3bc3138a400294ee9e126ac75fc9a9fae4e0b
5 changes: 5 additions & 0 deletions trunk/security/keys/permission.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ int key_task_permission(const key_ref_t key_ref, const struct cred *cred,

key = key_ref_to_ptr(key_ref);

if (key->user->user_ns != cred->user->user_ns)
goto use_other_perms;

/* use the second 8-bits of permissions for keys the caller owns */
if (key->uid == cred->fsuid) {
kperm = key->perm >> 16;
Expand All @@ -56,6 +59,8 @@ int key_task_permission(const key_ref_t key_ref, const struct cred *cred,
}
}

use_other_perms:

/* otherwise use the least-significant 8-bits */
kperm = key->perm;

Expand Down

0 comments on commit 01fdc78

Please sign in to comment.