Changeset 751 for trunk/server/source3/smbd/smb2_notify.c
- Timestamp:
- Nov 29, 2012, 1:59:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/smbd/smb2_notify.c
r745 r751 37 37 struct tevent_context *ev, 38 38 struct smbd_smb2_request *smb2req, 39 struct files_struct *in_fsp, 39 40 uint16_t in_flags, 40 41 uint32_t in_output_buffer_length, 41 uint64_t in_file_id_volatile,42 42 uint64_t in_completion_filter); 43 43 static NTSTATUS smbd_smb2_notify_recv(struct tevent_req *req, … … 48 48 NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req) 49 49 { 50 const uint8_t *inhdr;50 NTSTATUS status; 51 51 const uint8_t *inbody; 52 52 int i = req->current_idx; 53 size_t expected_body_size = 0x20;54 size_t body_size;55 53 uint16_t in_flags; 56 54 uint32_t in_output_buffer_length; 57 55 uint64_t in_file_id_persistent; 58 56 uint64_t in_file_id_volatile; 57 struct files_struct *in_fsp; 59 58 uint64_t in_completion_filter; 60 59 struct tevent_req *subreq; 61 60 62 inhdr = (const uint8_t *)req->in.vector[i+0].iov_base; 63 if (req->in.vector[i+1].iov_len != (expected_body_size & 0xFFFFFFFE)) { 64 return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); 65 } 66 61 status = smbd_smb2_request_verify_sizes(req, 0x20); 62 if (!NT_STATUS_IS_OK(status)) { 63 return smbd_smb2_request_error(req, status); 64 } 67 65 inbody = (const uint8_t *)req->in.vector[i+1].iov_base; 68 69 body_size = SVAL(inbody, 0x00);70 if (body_size != expected_body_size) {71 return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);72 }73 66 74 67 in_flags = SVAL(inbody, 0x02); … … 82 75 * Windows 2008 uses 0x00080000 83 76 */ 84 if (in_output_buffer_length > lp_smb2_max_trans()) {77 if (in_output_buffer_length > req->sconn->smb2.max_trans) { 85 78 return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); 86 79 } 87 80 88 if (req->compat_chain_fsp) { 89 /* skip check */ 90 } else if (in_file_id_persistent != in_file_id_volatile) { 81 in_fsp = file_fsp_smb2(req, in_file_id_persistent, in_file_id_volatile); 82 if (in_fsp == NULL) { 91 83 return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED); 92 84 } 93 85 94 subreq = smbd_smb2_notify_send(req, 95 req->sconn->smb2.event_ctx, 96 req, 86 subreq = smbd_smb2_notify_send(req, req->sconn->smb2.event_ctx, 87 req, in_fsp, 97 88 in_flags, 98 89 in_output_buffer_length, 99 in_file_id_volatile,100 90 in_completion_filter); 101 91 if (subreq == NULL) { … … 194 184 struct tevent_context *ev, 195 185 struct smbd_smb2_request *smb2req, 186 struct files_struct *fsp, 196 187 uint16_t in_flags, 197 188 uint32_t in_output_buffer_length, 198 uint64_t in_file_id_volatile,199 189 uint64_t in_completion_filter) 200 190 { … … 203 193 struct smb_request *smbreq; 204 194 connection_struct *conn = smb2req->tcon->compat_conn; 205 files_struct *fsp;206 195 bool recursive = (in_flags & 0x0001) ? true : false; 207 196 NTSTATUS status; … … 217 206 state->im = NULL; 218 207 219 DEBUG(10,("smbd_smb2_notify_send: file_id[0x%016llX]\n",220 (unsigned long long)in_file_id_volatile));208 DEBUG(10,("smbd_smb2_notify_send: %s - fnum[%d]\n", 209 fsp_str_dbg(fsp), fsp->fnum)); 221 210 222 211 smbreq = smbd_smb2_fake_smb_request(smb2req); … … 227 216 state->smbreq = smbreq; 228 217 smbreq->async_priv = (void *)req; 229 230 fsp = file_fsp(smbreq, (uint16_t)in_file_id_volatile);231 if (fsp == NULL) {232 tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);233 return tevent_req_post(req, ev);234 }235 if (conn != fsp->conn) {236 tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);237 return tevent_req_post(req, ev);238 }239 if (smb2req->session->vuid != fsp->vuid) {240 tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);241 return tevent_req_post(req, ev);242 }243 218 244 219 { … … 383 358 struct smbd_smb2_notify_state); 384 359 360 state->smb2req->cancelled = true; 385 361 smbd_notify_cancel_by_smbreq(state->smbreq); 386 362 387 state->smb2req->cancelled = true;388 tevent_req_done(req);389 363 return true; 390 364 }
Note:
See TracChangeset
for help on using the changeset viewer.