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