summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>2008-01-15 13:58:47 +0000
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>2008-01-15 13:58:47 +0000
commit9788383a6c08189564cd18a824aab4ccdbe57a21 (patch)
treee93ab7b1007d79e951f69a1495ac7e474536eb25 /source3/smbd/open.c
parent011e89c85868ec8f16e475a560a0e5bd41995920 (diff)
parent97f61b542c0e6b1f25ed08fa36792fd90a981e0e (diff)
downloadsamba-9788383a6c08189564cd18a824aab4ccdbe57a21.tar.gz
samba-9788383a6c08189564cd18a824aab4ccdbe57a21.tar.bz2
samba-9788383a6c08189564cd18a824aab4ccdbe57a21.zip
Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-test
(This used to be commit 3a61e663e51fe620225691bc8673bf8800a36f47)
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 59699dfbd0..9d48bcc98b 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -598,12 +598,6 @@ static NTSTATUS open_mode_check(connection_struct *conn,
}
*file_existed = True;
-
- if (is_stat_open(access_mask)) {
- /* Stat open that doesn't trigger oplock breaks or share mode
- * checks... ! JRA. */
- return NT_STATUS_OK;
- }
/* A delete on close prohibits everything */
@@ -611,6 +605,12 @@ static NTSTATUS open_mode_check(connection_struct *conn,
return NT_STATUS_DELETE_PENDING;
}
+ if (is_stat_open(access_mask)) {
+ /* Stat open that doesn't trigger oplock breaks or share mode
+ * checks... ! JRA. */
+ return NT_STATUS_OK;
+ }
+
/*
* Check if the share modes will give us access.
*/
@@ -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;
+ }
}
/*