Commit e1761424 authored by Nathan Scott's avatar Nathan Scott

[XFS] Make the XFS access checks like the other Linux filesystems for DAC.

SGI Modid: xfs-linux:xfs-kern:169300a
parent 2606a07a
......@@ -3707,14 +3707,13 @@ xfs_iaccess(
* 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
......
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