Revert "source3/smbd"
[metze/samba/wip.git] / source3 / smbd / smb2_lock.c
index 1549fcf70851857fbbabbfc4ea1fd394c139cbdf..fdca266a2764f35153c286578a9e9e57fe0b5e55 100644 (file)
@@ -47,7 +47,6 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
                                                 struct tevent_context *ev,
                                                 struct smbd_smb2_request *smb2req,
                                                 uint32_t in_smbpid,
-                                                uint64_t in_file_id_persistent,
                                                 uint64_t in_file_id_volatile,
                                                 uint16_t in_lock_count,
                                                 struct smbd_smb2_lock_element *in_locks);
@@ -91,6 +90,12 @@ NTSTATUS smbd_smb2_request_process_lock(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
        }
 
+       if (req->compat_chain_fsp) {
+               /* skip check */
+       } else if (in_file_id_persistent != in_file_id_volatile) {
+               return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
+       }
+
        in_locks = talloc_array(req, struct smbd_smb2_lock_element,
                                in_lock_count);
        if (in_locks == NULL) {
@@ -120,7 +125,6 @@ NTSTATUS smbd_smb2_request_process_lock(struct smbd_smb2_request *req)
                                     req->sconn->ev_ctx,
                                     req,
                                     in_smbpid,
-                                    in_file_id_persistent,
                                     in_file_id_volatile,
                                     in_lock_count,
                                     in_locks);
@@ -204,7 +208,6 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
                                                 struct tevent_context *ev,
                                                 struct smbd_smb2_request *smb2req,
                                                 uint32_t in_smbpid,
-                                                uint64_t in_file_id_persistent,
                                                 uint64_t in_file_id_volatile,
                                                 uint16_t in_lock_count,
                                                 struct smbd_smb2_lock_element *in_locks)
@@ -243,12 +246,6 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
                tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);
                return tevent_req_post(req, ev);
        }
-       if (smb2req->compat_chain_fsp) {
-               /* skip check */
-       } else if (in_file_id_persistent != fsp->smbXsrv->global->open_persistent_id) {
-               tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);
-               return tevent_req_post(req, ev);
-       }
        if (conn != fsp->conn) {
                tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);
                return tevent_req_post(req, ev);