Changeset 232 for branches/samba-3.2.x/source/smbd/reply.c
- Timestamp:
- May 27, 2009, 9:09:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/smbd/reply.c
r228 r232 2363 2363 2364 2364 if (!NT_STATUS_IS_OK(status)) { 2365 DEBUG(10, (" open_file_ntcreatefailed: %s\n",2365 DEBUG(10, ("create_file_unixpath failed: %s\n", 2366 2366 nt_errstr(status))); 2367 2367 return status; … … 3203 3203 3204 3204 if ((nread = SMB_VFS_SENDFILE(smbd_server_fd(), fsp, &header, startpos, smb_maxcnt)) == -1) { 3205 /* Returning ENOSYS or EINVAL means no data at all was sent.3205 /* Returning ENOSYS means no data at all was sent. 3206 3206 Do this as a normal read. */ 3207 if (errno == ENOSYS || errno == EINVAL) {3207 if (errno == ENOSYS) { 3208 3208 goto normal_read; 3209 3209 } … … 3894 3894 return false; 3895 3895 } 3896 if (IS_PRINT(conn)) { 3897 DEBUG(10,("is_valid_writeX_buffer: printing tid\n")); 3898 return false; 3899 } 3896 3900 doff = SVAL(inbuf,smb_vwv11); 3897 3901 … … 4634 4638 files_struct *fsp; 4635 4639 NTSTATUS status; 4640 SMB_STRUCT_STAT sbuf; 4636 4641 4637 4642 START_PROFILE(SMBsplopen); … … 4657 4662 4658 4663 /* Open for exclusive use, write only. */ 4659 status = print_fsp_open(conn, NULL, fsp );4664 status = print_fsp_open(conn, NULL, fsp, &sbuf); 4660 4665 4661 4666 if (!NT_STATUS_IS_OK(status)) { … … 5476 5481 NTSTATUS status = NT_STATUS_OK; 5477 5482 struct share_mode_lock *lck = NULL; 5478 bool dst_exists ;5483 bool dst_exists, old_is_stream, new_is_stream; 5479 5484 5480 5485 ZERO_STRUCT(sbuf); … … 5545 5550 } 5546 5551 5552 old_is_stream = is_ntfs_stream_name(fsp->fsp_name); 5553 new_is_stream = is_ntfs_stream_name(newname); 5554 5555 /* Return the correct error code if both names aren't streams. */ 5556 if (!old_is_stream && new_is_stream) { 5557 return NT_STATUS_OBJECT_NAME_INVALID; 5558 } 5559 5560 if (old_is_stream && !new_is_stream) { 5561 return NT_STATUS_INVALID_PARAMETER; 5562 } 5563 5547 5564 /* 5548 5565 * Have vfs_object_exist also fill sbuf1 … … 5556 5573 } 5557 5574 5558 if(replace_if_exists && dst_exists) {5559 if (is_ntfs_stream_name(newname)) {5560 return NT_STATUS_INVALID_PARAMETER;5561 }5562 }5563 5564 5575 if (dst_exists) { 5565 5576 struct file_id fileid = vfs_file_id_from_sbuf(conn, &sbuf1); 5566 5577 files_struct *dst_fsp = file_find_di_first(fileid); 5567 if (dst_fsp) { 5578 /* The file can be open when renaming a stream */ 5579 if (dst_fsp && !new_is_stream) { 5568 5580 DEBUG(3, ("rename_internals_fsp: Target file open\n")); 5569 5581 return NT_STATUS_ACCESS_DENIED; … … 5624 5636 * depends on these semantics. JRA. 5625 5637 */ 5626 5627 set_allow_initial_delete_on_close(lck, fsp, True);5628 5638 5629 5639 if (create_options & FILE_DELETE_ON_CLOSE) {
Note:
See TracChangeset
for help on using the changeset viewer.