patch-2.4.26 linux-2.4.26/fs/xfs/xfs_inode.c

Next file: linux-2.4.26/fs/xfs/xfs_iomap.c
Previous file: linux-2.4.26/fs/xfs/xfs_fsops.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.25/fs/xfs/xfs_inode.c linux-2.4.26/fs/xfs/xfs_inode.c
@@ -3707,13 +3707,13 @@
 	 * Read/write DACs are always overridable.
 	 * Executable DACs are overridable if at least one exec bit is set.
 	 */
-	if ((orgmode & (S_IRUSR|S_IWUSR)) || (inode->i_mode & S_IXUGO))
+	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

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)