commit | ba57ea64cb1820deb37637de0fdb107f0dc90089 | [log] [tgz] |
---|---|---|
author | Al Viro <viro@zeniv.linux.org.uk> | Sat Jul 20 03:11:32 2013 +0400 |
committer | Al Viro <viro@zeniv.linux.org.uk> | Sat Jul 20 03:11:32 2013 +0400 |
tree | dd8d302d4f16107e87b555aca3630ada6fcd472a | |
parent | c0d15cc7ee8c0d1970197d9eb1727503bcdd2471 [diff] [blame] |
allow O_TMPFILE to work with O_WRONLY Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/fs/open.c b/fs/open.c index 9156cb0..d53e298 100644 --- a/fs/open.c +++ b/fs/open.c
@@ -844,6 +844,8 @@ if ((flags & O_TMPFILE_MASK) != O_TMPFILE) return -EINVAL; acc_mode = MAY_OPEN | ACC_MODE(flags); + if (!(acc_mode & MAY_WRITE)) + return -EINVAL; } else if (flags & O_PATH) { /* * If we have O_PATH in the open flag. Then we