r740: Fix Bug #1301. Return NT_STATUS_SHARING_VIOLATION when share mode locking
authorRichard Sharpe <sharpe@samba.org>
Fri, 14 May 2004 20:58:26 +0000 (20:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:51:36 +0000 (10:51 -0500)
requests fail.
(This used to be commit 5082eb30d0d7c3a4c79b7578457682523a4e80a3)

source3/smbd/open.c

index 8ab5dab6ac9322cf11bbb15828a8fd677465f529..235a455f3027c9dcb966dcac7966431a4cea13da 100644 (file)
@@ -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;
                }