Commit deaeb66a authored by Andries E. Brouwer's avatar Andries E. Brouwer Committed by Linus Torvalds

[PATCH] minor CAP_DAC_OVERRIDE fix

CAP_DAC_OVERRIDE fails to give search permission in a directory with
mode 0.

Patch acked by Chris Wright <chrisw@osdl.org>
Signed-off-by: default avatarAndries Brouwer <aeb@cwi.nl>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3ac51a16
......@@ -316,7 +316,7 @@ static inline int exec_permission_lite(struct inode *inode,
{
umode_t mode = inode->i_mode;
if ((inode->i_op && inode->i_op->permission))
if (inode->i_op && inode->i_op->permission)
return -EAGAIN;
if (current->fsuid == inode->i_uid)
......@@ -330,6 +330,9 @@ static inline int exec_permission_lite(struct inode *inode,
if ((inode->i_mode & S_IXUGO) && capable(CAP_DAC_OVERRIDE))
goto ok;
if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_OVERRIDE))
goto ok;
if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_READ_SEARCH))
goto ok;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment