diff options
author | Volker Lendecke <vl@samba.org> | 2008-01-11 21:53:29 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-01-12 20:11:10 +0100 |
commit | 4c0ca860515a799ddcda3804fe4c2080d1df9b80 (patch) | |
tree | 39ed0c6a55e4e96405c30ac6d4e583a22cada5b1 /source3/smbd | |
parent | 360673e80e8d46167afb6c393773895b369ff290 (diff) | |
download | samba-4c0ca860515a799ddcda3804fe4c2080d1df9b80.tar.gz samba-4c0ca860515a799ddcda3804fe4c2080d1df9b80.tar.bz2 samba-4c0ca860515a799ddcda3804fe4c2080d1df9b80.zip |
There's no point in calling FLOCK on a non-existing fd
(This used to be commit 9ff79f231f1206631662b5c521ecddf5df9141c0)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/open.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 59699dfbd0..d1679209bb 100644 --- a/source3/smbd/open.c +++ b/source3/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; + } } /* |