Skip to content

Commit

Permalink
fix comment in generic_permission()
Browse files Browse the repository at this point in the history
CAP_DAC_OVERRIDE is enough for MAY_EXEC on directory, even if
no exec bits are set.

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Jun 20, 2011
1 parent 6291176 commit 8e833fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ int generic_permission(struct inode *inode, int mask, unsigned int flags,

/*
* Read/write DACs are always overridable.
* Executable DACs are overridable if at least one exec bit is set.
* Executable DACs are overridable for all directories and
* for non-directories that have least one exec bit set.
*/
if (!(mask & MAY_EXEC) || execute_ok(inode))
if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
Expand Down

0 comments on commit 8e833fd

Please sign in to comment.