summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorGerald (Jerry) Carter <jerry@samba.org>2008-01-14 09:49:47 -0600
committerGerald (Jerry) Carter <jerry@samba.org>2008-01-14 09:49:47 -0600
commit582bd8071f168190e0cf1f6d1637f79ebee287c3 (patch)
treed10d1f8ebab5bdd0d6644f6fbf98d7a825ce6f84 /source3/smbd/open.c
parent84f12a59600bc3f686959d0e17cf972319059e02 (diff)
parent351377a90e44d8011a697779d2e9e225427e5cbb (diff)
downloadsamba-582bd8071f168190e0cf1f6d1637f79ebee287c3.tar.gz
samba-582bd8071f168190e0cf1f6d1637f79ebee287c3.tar.bz2
samba-582bd8071f168190e0cf1f6d1637f79ebee287c3.zip
Merge commit 'samba/v3-2-test' into v3-2-stable
(This used to be commit 6811ea1ce2d46f7303b4edf661e27d2edf54724f)
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;
+ }
}
/*