From 4c1602a03d8c9f8498a804febc2cd418ed587c58 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 12 Jan 2008 14:06:34 -0800 Subject: [PATCH] --- yaml --- r: 75392 b: refs/heads/master c: 974a9f0b47da74e28f68b9c8645c3786aa5ace1a h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 46de29cb2726..6efe10b31874 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d0c4c9d4a2e46f052178806c4004d52cd3ae040f +refs/heads/master: 974a9f0b47da74e28f68b9c8645c3786aa5ace1a diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 3b993db26cee..73e2e665817a 100644 --- a/trunk/fs/namei.c +++ b/trunk/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);