Ignore:
Timestamp:
May 20, 2009, 6:46:53 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.4

File:
1 edited

Legend:

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

    r154 r204  
    749749                                    + data_alignment_offset);
    750750
    751         /* useable_space can never be more than max_send minus the alignment offset. */
    752 
    753         useable_space = MIN(useable_space, max_send - (alignment_offset+data_alignment_offset));
     751        if (useable_space < 0) {
     752                DEBUG(0, ("send_trans2_replies failed sanity useable_space "
     753                          "= %d!!!", useable_space));
     754                exit_server_cleanly("send_trans2_replies: Not enough space");
     755        }
    754756
    755757        while (params_to_send || data_to_send) {
    756758                /* Calculate whether we will totally or partially fill this packet */
    757759
    758                 total_sent_thistime = params_to_send + data_to_send + alignment_offset + data_alignment_offset;
     760                total_sent_thistime = params_to_send + data_to_send;
    759761
    760762                /* We can never send more than useable_space */
     
    766768                 */
    767769
    768                 total_sent_thistime = MIN(total_sent_thistime, useable_space+ alignment_offset + data_alignment_offset);
    769 
    770                 reply_outbuf(req, 10, total_sent_thistime);
     770                total_sent_thistime = MIN(total_sent_thistime, useable_space);
     771
     772                reply_outbuf(req, 10, total_sent_thistime + alignment_offset
     773                             + data_alignment_offset);
    771774
    772775                /* Set total params and data to be sent */
     
    19471950                case SMB_FIND_FILE_UNIX:
    19481951                case SMB_FIND_FILE_UNIX_INFO2:
     1952                        /* Always use filesystem for UNIX mtime query. */
     1953                        ask_sharemode = false;
    19491954                        if (!lp_unix_extensions()) {
    19501955                                reply_nterror(req, NT_STATUS_INVALID_LEVEL);
     
    23042309                case SMB_FIND_FILE_UNIX:
    23052310                case SMB_FIND_FILE_UNIX_INFO2:
     2311                        /* Always use filesystem for UNIX mtime query. */
     2312                        ask_sharemode = false;
    23062313                        if (!lp_unix_extensions()) {
    23072314                                reply_nterror(req, NT_STATUS_INVALID_LEVEL);
     
    41414148        }
    41424149
    4143         if (!null_timespec(write_time_ts)) {
     4150        if (!null_timespec(write_time_ts) && !INFO_LEVEL_IS_UNIX(info_level)) {
    41444151                mtime_ts = write_time_ts;
    41454152        }
     
    48964903
    48974904                if (fsp != NULL) {
    4898                         set_write_time_fsp(fsp, ts[1], true);
     4905                        set_sticky_write_time_fsp(fsp, ts[1]);
    48994906                } else {
    4900                         set_write_time_path(conn, fname,
     4907                        set_sticky_write_time_path(conn, fname,
    49014908                                            vfs_file_id_from_sbuf(conn, psbuf),
    4902                                             ts[1], true);
     4909                                            ts[1]);
    49034910                }
    49044911        }
     
    49924999                        return map_nt_error_from_unix(errno);
    49935000                }
     5001                trigger_write_time_update_immediate(fsp);
    49945002                return NT_STATUS_OK;
    49955003        }
     
    50155023        }
    50165024
     5025        trigger_write_time_update_immediate(new_fsp);
    50175026        close_file(new_fsp,NORMAL_CLOSE);
    50185027        return NT_STATUS_OK;
     
    57405749                 * if there are no pending writes.
    57415750                 */
    5742                 trigger_write_time_update(fsp);
     5751                trigger_write_time_update_immediate(fsp);
    57435752                return NT_STATUS_OK;
    57445753        }
     
    57745783         * if there are no pending writes.
    57755784         */
    5776         trigger_write_time_update(new_fsp);
     5785        trigger_write_time_update_immediate(new_fsp);
    57775786
    57785787        close_file(new_fsp,NORMAL_CLOSE);
Note: See TracChangeset for help on using the changeset viewer.