Changeset 751 for trunk/server/source3/smbd/smb2_close.c
- Timestamp:
- Nov 29, 2012, 1:59:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/smbd/smb2_close.c
r745 r751 25 25 26 26 static NTSTATUS smbd_smb2_close(struct smbd_smb2_request *req, 27 struct files_struct *fsp, 27 28 uint16_t in_flags, 28 uint64_t in_file_id_volatile,29 29 DATA_BLOB *outbody); 30 30 31 31 NTSTATUS smbd_smb2_request_process_close(struct smbd_smb2_request *req) 32 32 { 33 const uint8_t *inhdr;34 33 const uint8_t *inbody; 35 34 int i = req->current_idx; 36 35 uint8_t *outhdr; 37 36 DATA_BLOB outbody; 38 size_t expected_body_size = 0x18;39 size_t body_size;40 37 uint16_t in_flags; 41 38 uint64_t in_file_id_persistent; 42 39 uint64_t in_file_id_volatile; 40 struct files_struct *in_fsp; 43 41 NTSTATUS status; 44 42 45 inhdr = (const uint8_t *)req->in.vector[i+0].iov_base;46 if ( req->in.vector[i+1].iov_len != (expected_body_size & 0xFFFFFFFE)) {47 return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);43 status = smbd_smb2_request_verify_sizes(req, 0x18); 44 if (!NT_STATUS_IS_OK(status)) { 45 return smbd_smb2_request_error(req, status); 48 46 } 49 50 47 inbody = (const uint8_t *)req->in.vector[i+1].iov_base; 51 52 body_size = SVAL(inbody, 0x00);53 if (body_size != expected_body_size) {54 return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);55 }56 48 57 49 outbody = data_blob_talloc(req->out.vector, NULL, 0x3C); … … 64 56 in_file_id_volatile = BVAL(inbody, 0x10); 65 57 66 if (req->compat_chain_fsp) { 67 /* skip check */ 68 } else if (in_file_id_persistent != in_file_id_volatile) { 58 in_fsp = file_fsp_smb2(req, in_file_id_persistent, in_file_id_volatile); 59 if (in_fsp == NULL) { 69 60 return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED); 70 61 } 71 62 72 63 status = smbd_smb2_close(req, 64 in_fsp, 73 65 in_flags, 74 in_file_id_volatile,75 66 &outbody); 76 67 if (!NT_STATUS_IS_OK(status)) { … … 83 74 84 75 static NTSTATUS smbd_smb2_close(struct smbd_smb2_request *req, 76 struct files_struct *fsp, 85 77 uint16_t in_flags, 86 uint64_t in_file_id_volatile,87 78 DATA_BLOB *outbody) 88 79 { … … 90 81 struct smb_request *smbreq; 91 82 connection_struct *conn = req->tcon->compat_conn; 92 files_struct *fsp;93 83 struct smb_filename *smb_fname = NULL; 94 84 struct timespec mdate_ts, adate_ts, cdate_ts, create_date_ts; … … 104 94 ZERO_STRUCT(cdate_ts); 105 95 106 DEBUG(10,("smbd_smb2_close: file_id[0x%016llX]\n",107 (unsigned long long)in_file_id_volatile));96 DEBUG(10,("smbd_smb2_close: %s - fnum[%d]\n", 97 fsp_str_dbg(fsp), fsp->fnum)); 108 98 109 99 smbreq = smbd_smb2_fake_smb_request(req); 110 100 if (smbreq == NULL) { 111 101 return NT_STATUS_NO_MEMORY; 112 }113 114 fsp = file_fsp(smbreq, (uint16_t)in_file_id_volatile);115 if (fsp == NULL) {116 return NT_STATUS_FILE_CLOSED;117 }118 if (conn != fsp->conn) {119 return NT_STATUS_FILE_CLOSED;120 }121 if (req->session->vuid != fsp->vuid) {122 return NT_STATUS_FILE_CLOSED;123 102 } 124 103
Note:
See TracChangeset
for help on using the changeset viewer.