https://github.com/torvalds/linux
Revision 1574dff8996ab1ed92c09012f8038b5566fce313 authored by Sachin Prabhu on 20 April 2011, 12:09:35 UTC, committed by J. Bruce Fields on 20 April 2011, 15:03:01 UTC
An open on a NFS4 share using the O_CREAT flag on an existing file for
which we have permissions to open but contained in a directory with no
write permissions will fail with EACCES.

A tcpdump shows that the client had set the open mode to UNCHECKED which
indicates that the file should be created if it doesn't exist and
encountering an existing flag is not an error. Since in this case the
file exists and can be opened by the user, the NFS server is wrong in
attempting to check create permissions on the parent directory.

The patch adds a conditional statement to check for create permissions
only if the file doesn't exist.

Signed-off-by: Sachin S. Prabhu <sprabhu@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent a96e5b9
History
Tip revision: 1574dff8996ab1ed92c09012f8038b5566fce313 authored by Sachin Prabhu on 20 April 2011, 12:09:35 UTC
Open with O_CREAT flag set fails to open existing files on non writable directories
Tip revision: 1574dff
File Mode Size
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore -rw-r--r-- 941 bytes
.mailmap -rw-r--r-- 4.1 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 91.7 KB
Kbuild -rw-r--r-- 2.4 KB
Kconfig -rw-r--r-- 252 bytes
MAINTAINERS -rw-r--r-- 188.1 KB
Makefile -rw-r--r-- 51.1 KB
README -rw-r--r-- 17.1 KB
REPORTING-BUGS -rw-r--r-- 3.3 KB

README

back to top