Fix more SMB2-OPLOCK bugs. Only 3 more issues to address then we're good to go on...
[kamenim/samba.git] / source3 / smbd / trans2.c
index 25ca3fd3aee8c696ff299d37ea410d3dec433bc5..5d51a7fb90267766ed3f54b06a0f279df0b6b589 100644 (file)
@@ -5951,7 +5951,15 @@ static NTSTATUS smb2_file_rename_information(connection_struct *conn,
                return status;
        }
 
-       if (fsp && fsp->base_fsp) {
+       /* Ok, this looks wrong to me, but appears to
+        * be how SMB2 renames work. CHECK WITH Microsoft !
+        * jra.
+        */
+       if (fsp->oplock_type != NO_OPLOCK) {
+               return NT_STATUS_SHARING_VIOLATION;
+       }
+
+       if (fsp->base_fsp) {
                /* newname must be a stream name. */
                if (newname[0] != ':') {
                        return NT_STATUS_NOT_SUPPORTED;