* Read/write DACs are always overridable.
* Executable DACs are overridable if at least one exec bit is set.
*/
- if (!(orgmode & S_IXUSR) || (inode->i_mode & S_IXUGO) ||
- (ip->i_d.di_mode & S_IFMT) == S_IFDIR)
+ if (!(orgmode & S_IXUSR) ||
+ (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode))
if (capable_cred(cr, CAP_DAC_OVERRIDE))
return 0;
if ((orgmode == S_IRUSR) ||
- (((ip->i_d.di_mode & S_IFMT) == S_IFDIR) &&
- (!(orgmode & ~(S_IWUSR|S_IXUSR))))) {
+ (S_ISDIR(inode->i_mode) && (!(orgmode & S_IWUSR)))) {
if (capable_cred(cr, CAP_DAC_READ_SEARCH))
return 0;
#ifdef NOISE