]> git.neil.brown.name Git - history.git/commitdiff
[XFS] Make the XFS access checks like the other Linux filesystems for DAC.
authorNathan Scott <nathans@sgi.com>
Thu, 1 Apr 2004 22:16:22 +0000 (08:16 +1000)
committerNathan Scott <nathans@sgi.com>
Thu, 1 Apr 2004 22:16:22 +0000 (08:16 +1000)
SGI Modid: xfs-linux:xfs-kern:169300a

fs/xfs/xfs_inode.c

index 195b34a822366c90c823a836efa5f5d44acd0ad9..ec2ab5263f8353dd0119234406b3943264590bf7 100644 (file)
@@ -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