diff options
author | Sachin Prabhu <sprabhu@redhat.com> | 2011-04-20 13:09:35 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-09 15:06:48 -0700 |
commit | 6f0a6240e8ce1659574e944eac04e871a9dc1fe7 (patch) | |
tree | 593d99950553e629afd0540628784c18c93826cd /net | |
parent | 7b17624a7f6b41678d7452ebd5a525ddc3aaf3d3 (diff) |
Open with O_CREAT flag set fails to open existing files on non writable directories
commit 1574dff8996ab1ed92c09012f8038b5566fce313 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions