Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24-rc7-git6 /fs/namei.c

Filename:/fs/namei.c
Lines Added:2
Lines Deleted:2
Also changed in: (Previous) 2.6.24-rc7-git5  2.6.24-rc7  2.6.24-rc6  2.6.24-rc5  2.6.24-rc4  2.6.24-rc3 
(Following) 2.6.24-rc7-git7  2.6.24-rc7-git8  2.6.24-rc8  2.6.24  2.6.24-git16  2.6.24-git17 

Location
[  2.6.24-rc7-git6
  [  fs
     o  namei.c

Patch

diff --git a/fs/namei.c b/fs/namei.c
index 3b993db..73e2e66 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1605,7 +1605,7 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
    if (S_ISLNK(inode->i_mode))
       return -ELOOP;
    
-   if (S_ISDIR(inode->i_mode) && (flag & FMODE_WRITE))
+   if (S_ISDIR(inode->i_mode) && (acc_mode & MAY_WRITE))
       return -EISDIR;
 
    /*
@@ -1620,7 +1620,7 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
          return -EACCES;
 
       flag &= ~O_TRUNC;
-   } else if (IS_RDONLY(inode) && (flag & FMODE_WRITE))
+   } else if (IS_RDONLY(inode) && (acc_mode & MAY_WRITE))
       return -EROFS;
 
    error = vfs_permission(nd, acc_mode);


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.