lock ...
authorStefan Metzmacher <metze@samba.org>
Fri, 10 Feb 2012 08:45:59 +0000 (09:45 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 10 May 2012 16:41:23 +0000 (18:41 +0200)
source3/smbd/smb2_find.c
source3/smbd/smb2_flush.c
source3/smbd/smb2_lock.c
source3/smbd/smb2_notify.c

index 375e86a52921eb9f3e217848f6d7fbf87ec9cda8..1854f3457db03302a39a01e2c7637f2cefb965e8 100644 (file)
@@ -116,12 +116,6 @@ NTSTATUS smbd_smb2_request_process_find(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_OBJECT_NAME_INVALID);
        }
 
-       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);
-       }
-
        subreq = smbd_smb2_find_send(req,
                                     req->sconn->ev_ctx,
                                     req,
index 5ca2fa8457126f3b673159abf2c6adf4f1e2f40e..66dd22a7edd0abe394c4454aa311ed5e20e0b03f 100644 (file)
@@ -50,12 +50,6 @@ NTSTATUS smbd_smb2_request_process_flush(struct smbd_smb2_request *req)
        in_file_id_persistent   = BVAL(inbody, 0x08);
        in_file_id_volatile     = BVAL(inbody, 0x10);
 
-       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);
-       }
-
        subreq = smbd_smb2_flush_send(req,
                                      req->sconn->ev_ctx,
                                      req,
index fdca266a2764f35153c286578a9e9e57fe0b5e55..1549fcf70851857fbbabbfc4ea1fd394c139cbdf 100644 (file)
@@ -47,6 +47,7 @@ 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);
@@ -90,12 +91,6 @@ 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) {
@@ -125,6 +120,7 @@ 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);
@@ -208,6 +204,7 @@ 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)
@@ -246,6 +243,12 @@ 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);
index 28966472952b026b9196fdf8e7938c2959239849..aad37d352252eda7cce666fa9740ac66c505cc3f 100644 (file)
@@ -85,12 +85,6 @@ NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, status);
        }
 
-       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);
-       }
-
        subreq = smbd_smb2_notify_send(req,
                                       req->sconn->ev_ctx,
                                       req,