Changeset 745 for trunk/server/source3/smbd/smb2_setinfo.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/smbd/smb2_setinfo.c
r414 r745 4 4 5 5 Copyright (C) Stefan Metzmacher 2009 6 Copyright (C) Jeremy Allison 2010 6 7 7 8 This program is free software; you can redistribute it and/or modify … … 20 21 21 22 #include "includes.h" 23 #include "smbd/smbd.h" 22 24 #include "smbd/globals.h" 23 25 #include "../libcli/smb/smb_common.h" 26 #include "trans2.h" 27 #include "../lib/util/tevent_ntstatus.h" 24 28 25 29 static struct tevent_req *smbd_smb2_setinfo_send(TALLOC_CTX *mem_ctx, … … 88 92 if (req->compat_chain_fsp) { 89 93 /* skip check */ 90 } else if (in_file_id_persistent != 0) {94 } else if (in_file_id_persistent != in_file_id_volatile) { 91 95 return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED); 92 96 } … … 162 166 uint64_t in_file_id_volatile) 163 167 { 164 struct tevent_req *req ;165 struct smbd_smb2_setinfo_state *state ;166 struct smb_request *smbreq ;168 struct tevent_req *req = NULL; 169 struct smbd_smb2_setinfo_state *state = NULL; 170 struct smb_request *smbreq = NULL; 167 171 connection_struct *conn = smb2req->tcon->compat_conn; 168 files_struct *fsp; 172 files_struct *fsp = NULL; 173 NTSTATUS status; 169 174 170 175 req = tevent_req_create(mem_ctx, &state, … … 209 214 int data_size; 210 215 int ret_size = 0; 211 NTSTATUS status;212 216 213 217 214 218 file_info_level = in_file_info_class + 1000; 215 219 if (file_info_level == SMB_FILE_RENAME_INFORMATION) { 216 file_info_level = 0xFF00 + in_file_info_class; 217 } 218 219 if (fsp->is_directory || fsp->fh->fd == -1) { 220 /* SMB2_FILE_RENAME_INFORMATION_INTERNAL == 0xFF00 + in_file_info_class */ 221 file_info_level = SMB2_FILE_RENAME_INFORMATION_INTERNAL; 222 if (fsp->oplock_type != FAKE_LEVEL_II_OPLOCK && 223 fsp->oplock_type != NO_OPLOCK) { 224 /* No break, but error. */ 225 tevent_req_nterror(req, NT_STATUS_SHARING_VIOLATION); 226 return tevent_req_post(req, ev); 227 } 228 } 229 230 if (fsp->fh->fd == -1) { 220 231 /* 221 232 * This is actually a SETFILEINFO on a directory … … 252 263 && in_input_buffer.length >= 1 253 264 && CVAL(in_input_buffer.data,0)) { 254 fsp->fh->private_options |= FILE_DELETE_ON_CLOSE;265 fsp->fh->private_options |= NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE; 255 266 256 267 DEBUG(3,("smbd_smb2_setinfo_send: " … … 285 296 data = (char *)SMB_MALLOC_ARRAY(char, data_size); 286 297 if (tevent_req_nomem(data, req)) { 287 298 return tevent_req_post(req, ev); 288 299 } 289 300 memcpy(data, in_input_buffer.data, data_size); … … 308 319 } 309 320 321 case 0x03:/* SMB2_SETINFO_SECURITY */ 322 { 323 if (!CAN_WRITE(conn)) { 324 tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED); 325 return tevent_req_post(req, ev); 326 } 327 328 status = set_sd(fsp, 329 in_input_buffer.data, 330 in_input_buffer.length, 331 in_additional_information); 332 if (!NT_STATUS_IS_OK(status)) { 333 tevent_req_nterror(req, status); 334 return tevent_req_post(req, ev); 335 } 336 break; 337 } 338 310 339 default: 311 340 tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
Note:
See TracChangeset
for help on using the changeset viewer.