Changeset 751 for trunk/server/source3/smbd/smb2_break.c
- Timestamp:
- Nov 29, 2012, 1:59:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/smbd/smb2_break.c
r745 r751 29 29 struct tevent_context *ev, 30 30 struct smbd_smb2_request *smb2req, 31 uint8_t in_oplock_level,32 uint 64_t in_file_id_volatile);31 struct files_struct *in_fsp, 32 uint8_t in_oplock_level); 33 33 static NTSTATUS smbd_smb2_oplock_break_recv(struct tevent_req *req, 34 34 uint8_t *out_oplock_level); … … 37 37 NTSTATUS smbd_smb2_request_process_break(struct smbd_smb2_request *req) 38 38 { 39 const uint8_t *inhdr;39 NTSTATUS status; 40 40 const uint8_t *inbody; 41 41 int i = req->current_idx; 42 size_t expected_body_size = 0x18;43 size_t body_size;44 42 uint8_t in_oplock_level; 45 43 uint64_t in_file_id_persistent; 46 44 uint64_t in_file_id_volatile; 45 struct files_struct *in_fsp; 47 46 struct tevent_req *subreq; 48 47 49 inhdr = (const uint8_t *)req->in.vector[i+0].iov_base; 50 if (req->in.vector[i+1].iov_len != (expected_body_size & 0xFFFFFFFE)) { 51 return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); 52 } 53 48 status = smbd_smb2_request_verify_sizes(req, 0x18); 49 if (!NT_STATUS_IS_OK(status)) { 50 return smbd_smb2_request_error(req, status); 51 } 54 52 inbody = (const uint8_t *)req->in.vector[i+1].iov_base; 55 56 body_size = SVAL(inbody, 0x00);57 if (body_size != expected_body_size) {58 return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);59 }60 53 61 54 in_oplock_level = CVAL(inbody, 0x02); … … 71 64 in_file_id_volatile = BVAL(inbody, 0x10); 72 65 73 if (req->compat_chain_fsp) { 74 /* skip check */ 75 } else if (in_file_id_persistent != in_file_id_volatile) { 66 in_fsp = file_fsp_smb2(req, in_file_id_persistent, in_file_id_volatile); 67 if (in_fsp == NULL) { 76 68 return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED); 77 69 } 78 70 79 subreq = smbd_smb2_oplock_break_send(req, 80 req->sconn->smb2.event_ctx, 81 req, 82 in_oplock_level, 83 in_file_id_volatile); 71 subreq = smbd_smb2_oplock_break_send(req, req->sconn->smb2.event_ctx, 72 req, in_fsp, in_oplock_level); 84 73 if (subreq == NULL) { 85 74 return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); … … 157 146 struct tevent_context *ev, 158 147 struct smbd_smb2_request *smb2req, 159 uint8_t in_oplock_level,160 uint 64_t in_file_id_volatile)148 struct files_struct *fsp, 149 uint8_t in_oplock_level) 161 150 { 162 151 struct tevent_req *req; 163 152 struct smbd_smb2_oplock_break_state *state; 164 153 struct smb_request *smbreq; 165 connection_struct *conn = smb2req->tcon->compat_conn;166 files_struct *fsp = NULL;167 154 int oplocklevel = map_smb2_oplock_levels_to_samba(in_oplock_level); 168 155 bool break_to_none = (oplocklevel == NO_OPLOCK); … … 177 164 state->out_oplock_level = SMB2_OPLOCK_LEVEL_NONE; 178 165 179 DEBUG(10,("smbd_smb2_oplock_break_send: file_id[0x%016llX] "180 "samba level %d\n",181 (unsigned long long)in_file_id_volatile,182 oplocklevel));166 DEBUG(10,("smbd_smb2_oplock_break_send: %s - fnum[%d] " 167 "samba level %d\n", 168 fsp_str_dbg(fsp), fsp->fnum, 169 oplocklevel)); 183 170 184 171 smbreq = smbd_smb2_fake_smb_request(smb2req); 185 172 if (tevent_req_nomem(smbreq, req)) { 186 return tevent_req_post(req, ev);187 }188 189 fsp = file_fsp(smbreq, (uint16_t)in_file_id_volatile);190 if (fsp == NULL) {191 tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);192 return tevent_req_post(req, ev);193 }194 if (conn != fsp->conn) {195 tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);196 return tevent_req_post(req, ev);197 }198 if (smb2req->session->vuid != fsp->vuid) {199 tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);200 173 return tevent_req_post(req, ev); 201 174 } … … 265 238 SMB2_OPLOCK_LEVEL_NONE; 266 239 NTSTATUS status; 240 uint64_t fsp_persistent = fsp_persistent_id(fsp); 267 241 268 242 DEBUG(10,("send_break_message_smb2: sending oplock break " … … 273 247 274 248 status = smbd_smb2_send_oplock_break(fsp->conn->sconn, 275 (uint64_t)fsp->fnum,249 fsp_persistent, 276 250 (uint64_t)fsp->fnum, 277 251 smb2_oplock_level);
Note:
See TracChangeset
for help on using the changeset viewer.