Ignore:
Timestamp:
May 27, 2009, 9:09:42 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/smbd/reply.c

    r228 r232  
    23632363
    23642364        if (!NT_STATUS_IS_OK(status)) {
    2365                 DEBUG(10, ("open_file_ntcreate failed: %s\n",
     2365                DEBUG(10, ("create_file_unixpath failed: %s\n",
    23662366                           nt_errstr(status)));
    23672367                return status;
     
    32033203
    32043204                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.
    32063206                           Do this as a normal read. */
    3207                         if (errno == ENOSYS || errno == EINVAL) {
     3207                        if (errno == ENOSYS) {
    32083208                                goto normal_read;
    32093209                        }
     
    38943894                return false;
    38953895        }
     3896        if (IS_PRINT(conn)) {
     3897                DEBUG(10,("is_valid_writeX_buffer: printing tid\n"));
     3898                return false;
     3899        }
    38963900        doff = SVAL(inbuf,smb_vwv11);
    38973901
     
    46344638        files_struct *fsp;
    46354639        NTSTATUS status;
     4640        SMB_STRUCT_STAT sbuf;
    46364641
    46374642        START_PROFILE(SMBsplopen);
     
    46574662
    46584663        /* Open for exclusive use, write only. */
    4659         status = print_fsp_open(conn, NULL, fsp);
     4664        status = print_fsp_open(conn, NULL, fsp, &sbuf);
    46604665
    46614666        if (!NT_STATUS_IS_OK(status)) {
     
    54765481        NTSTATUS status = NT_STATUS_OK;
    54775482        struct share_mode_lock *lck = NULL;
    5478         bool dst_exists;
     5483        bool dst_exists, old_is_stream, new_is_stream;
    54795484
    54805485        ZERO_STRUCT(sbuf);
     
    55455550        }
    55465551
     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
    55475564        /*
    55485565         * Have vfs_object_exist also fill sbuf1
     
    55565573        }
    55575574
    5558         if(replace_if_exists && dst_exists) {
    5559                 if (is_ntfs_stream_name(newname)) {
    5560                         return NT_STATUS_INVALID_PARAMETER;
    5561                 }
    5562         }
    5563 
    55645575        if (dst_exists) {
    55655576                struct file_id fileid = vfs_file_id_from_sbuf(conn, &sbuf1);
    55665577                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) {
    55685580                        DEBUG(3, ("rename_internals_fsp: Target file open\n"));
    55695581                        return NT_STATUS_ACCESS_DENIED;
     
    56245636                 * depends on these semantics. JRA.
    56255637                 */
    5626 
    5627                 set_allow_initial_delete_on_close(lck, fsp, True);
    56285638
    56295639                if (create_options & FILE_DELETE_ON_CLOSE) {
Note: See TracChangeset for help on using the changeset viewer.