summaryrefslogtreecommitdiffstats
path: root/source/smbd/open.c
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2004-05-14 20:58:26 +0000
committerRichard Sharpe <sharpe@samba.org>2004-05-14 20:58:26 +0000
commit69063deb569b7928d015810b0c14eed78b0afd1d (patch)
treef3a7f58a8d8507e98daa36b0d1eb46dd2d80f571 /source/smbd/open.c
parent868138fe69f9bee26433a499d9043dc40d050632 (diff)
downloadsamba-69063deb569b7928d015810b0c14eed78b0afd1d.tar.gz
samba-69063deb569b7928d015810b0c14eed78b0afd1d.tar.xz
samba-69063deb569b7928d015810b0c14eed78b0afd1d.zip
r740: Fix Bug #1301. Return NT_STATUS_SHARING_VIOLATION when share mode locking
requests fail.
Diffstat (limited to 'source/smbd/open.c')
-rw-r--r--source/smbd/open.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 8ab5dab6ac9..235a455f302 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -990,6 +990,13 @@ flags=0x%X flags2=0x%X mode=0%o returned %d\n",
if (fsp_open)
fd_close(conn, fsp);
file_free(fsp);
+ /*
+ * We have detected a sharing violation here
+ * so return the correct error code
+ */
+ unix_ERR_class = ERRDOS;
+ unix_ERR_code = ERRbadshare;
+ unix_ERR_ntstatus = NT_STATUS_SHARING_VIOLATION;
return NULL;
}
@@ -1057,6 +1064,13 @@ flags=0x%X flags2=0x%X mode=0%o returned %d\n",
unlock_share_entry_fsp(fsp);
fd_close(conn,fsp);
file_free(fsp);
+ /*
+ * We have detected a sharing violation here, so
+ * return the correct code.
+ */
+ unix_ERR_class = ERRDOS;
+ unix_ERR_code = ERRbadshare;
+ unix_ERR_ntstatus = NT_STATUS_SHARING_VIOLATION;
return NULL;
}