]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - fs/namei.c
Simplify exec_permission_lite() further
[linux-2.6.git] / fs / namei.c
index 8c3580610eec721d34bccd391d0cdf0f10d28626..929f535fb225944e11f76c0587f58e1c540f5b49 100644 (file)
@@ -445,13 +445,7 @@ static int exec_permission_lite(struct inode *inode)
        if (mode & MAY_EXEC)
                goto ok;
 
-       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))
+       if (capable(CAP_DAC_OVERRIDE) || capable(CAP_DAC_READ_SEARCH))
                goto ok;
 
        return -EACCES;