summaryrefslogtreecommitdiffstats
path: root/source/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-01-11 21:53:29 +0100
committerVolker Lendecke <vl@samba.org>2008-01-12 20:11:10 +0100
commit9ff79f231f1206631662b5c521ecddf5df9141c0 (patch)
tree1b8b53fa1138e9a8b1ed3d9ca3176d7c1aa17c60 /source/smbd
parent8809eaeb154ea12543455f589e31172dc905d83a (diff)
downloadsamba-9ff79f231f1206631662b5c521ecddf5df9141c0.tar.gz
samba-9ff79f231f1206631662b5c521ecddf5df9141c0.tar.xz
samba-9ff79f231f1206631662b5c521ecddf5df9141c0.zip
There's no point in calling FLOCK on a non-existing fd
Diffstat (limited to 'source/smbd')
-rw-r--r--source/smbd/open.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 59699dfbd0f..d1679209bb1 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -1761,14 +1761,16 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
the kernel refuses the operations then the kernel is wrong.
note that GPFS supports it as well - jmcd */
- ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access);
- if(ret_flock == -1 ){
+ if (fsp->fh->fd != -1) {
+ ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access);
+ if(ret_flock == -1 ){
- TALLOC_FREE(lck);
- fd_close(fsp);
- file_free(fsp);
-
- return NT_STATUS_SHARING_VIOLATION;
+ TALLOC_FREE(lck);
+ fd_close(fsp);
+ file_free(fsp);
+
+ return NT_STATUS_SHARING_VIOLATION;
+ }
}
/*