Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306008
b: refs/heads/master
c: 65cc5a1
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed May 15, 2012
1 parent 33d29e7 commit 3ee9d3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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: 9e4a36ece652908276bc4abb4324ec56292453e1
refs/heads/master: 65cc5a17ad3388f89ddc3d68226a09242656809b
6 changes: 4 additions & 2 deletions trunk/kernel/capability.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,14 @@ bool nsown_capable(int cap)
* targeted at it's own user namespace and that the given inode is owned
* by the current user namespace or a child namespace.
*
* Currently inodes can only be owned by the initial user namespace.
* Currently we check to see if an inode is owned by the current
* user namespace by seeing if the inode's owner maps into the
* current user namespace.
*
*/
bool inode_capable(const struct inode *inode, int cap)
{
struct user_namespace *ns = current_user_ns();

return ns_capable(ns, cap) && (ns == &init_user_ns);
return ns_capable(ns, cap) && kuid_has_mapping(ns, inode->i_uid);
}

0 comments on commit 3ee9d3b

Please sign in to comment.