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/trans2.c

    r228 r232  
    36753675        unsigned int ofs = 0;
    36763676
    3677         for (i=0; i<num_streams; i++) {
     3677        for (i = 0; i < num_streams && ofs <= max_data_bytes; i++) {
    36783678                unsigned int next_offset;
    36793679                size_t namelen;
     
    36933693
    36943694                namelen -= 2;
    3695 
    3696                 if (ofs + 24 + namelen > max_data_bytes) {
    3697                         TALLOC_FREE(namebuf);
    3698                         return NT_STATUS_BUFFER_TOO_SMALL;
    3699                 }
    37003695
    37013696                SIVAL(data, ofs+4, namelen);
     
    37123707                else {
    37133708                        unsigned int align = ndr_align_size(next_offset, 8);
    3714 
    3715                         if (next_offset + align > max_data_bytes) {
    3716                                 return NT_STATUS_BUFFER_TOO_SMALL;
    3717                         }
    37183709
    37193710                        memset(data+next_offset, 0, align);
     
    53535344        char *base_name = NULL;
    53545345        bool dest_has_wcard = False;
     5346        SMB_STRUCT_STAT sbuf;
     5347        char *newname_last_component = NULL;
    53555348        NTSTATUS status = NT_STATUS_OK;
    53565349        char *p;
     
    53605353                return NT_STATUS_INVALID_PARAMETER;
    53615354        }
     5355
     5356        ZERO_STRUCT(sbuf);
    53625357
    53635358        overwrite = (CVAL(pdata,0) ? True : False);
     
    53945389
    53955390        if (fsp && fsp->base_fsp) {
     5391                /* newname must be a stream name. */
    53965392                if (newname[0] != ':') {
    53975393                        return NT_STATUS_NOT_SUPPORTED;
     
    54045400                }
    54055401        } else {
     5402                /* newname must *not* be a stream name. */
    54065403                if (is_ntfs_stream_name(newname)) {
    54075404                        return NT_STATUS_NOT_SUPPORTED;
     
    54295426                        return NT_STATUS_NO_MEMORY;
    54305427                }
    5431         }
    5432 
    5433         if (fsp) {
    5434                 SMB_STRUCT_STAT sbuf;
    5435                 char *newname_last_component = NULL;
    5436 
    5437                 ZERO_STRUCT(sbuf);
    54385428
    54395429                status = unix_convert(ctx, conn, newname, False,
    5440                                         &newname,
    5441                                         &newname_last_component,
    5442                                         &sbuf);
     5430                                &newname,
     5431                                &newname_last_component,
     5432                                &sbuf);
    54435433
    54445434                /* If an error we expect this to be
     
    54505440                        return status;
    54515441                }
    5452 
     5442        }
     5443
     5444        if (fsp) {
    54535445                DEBUG(10,("smb_file_rename_information: SMB_FILE_RENAME_INFORMATION (fnum %d) %s -> %s\n",
    54545446                        fsp->fnum, fsp->fsp_name, base_name ));
Note: See TracChangeset for help on using the changeset viewer.