Ignore:
Timestamp:
Nov 27, 2012, 4:56:06 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated vendor to 3.6.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/libsmb/clireadwrite.c

    r740 r746  
    134134        SSVAL(state->vwv + 9, 0, 0);
    135135
    136         if ((uint64_t)offset >> 32) {
     136        if (cli->capabilities & CAP_LARGE_FILES) {
    137137                SIVAL(state->vwv + 10, 0,
    138138                      (((uint64_t)offset)>>32) & 0xffffffff);
    139                 wct += 2;
     139                wct = 12;
     140        } else {
     141                if ((((uint64_t)offset) & 0xffffffff00000000LL) != 0) {
     142                        DEBUG(10, ("cli_read_andx_send got large offset where "
     143                                   "the server does not support it\n"));
     144                        tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
     145                        return tevent_req_post(req, ev);
     146                }
    140147        }
    141148
     
    216223        state->buf = (uint8_t *)smb_base(inbuf) + SVAL(vwv+6, 0);
    217224
    218         if (trans_oob(smb_len(inbuf), SVAL(vwv+6, 0), state->received)
     225        if (trans_oob(smb_len_large(inbuf), SVAL(vwv+6, 0), state->received)
    219226            || ((state->received != 0) && (state->buf < bytes))) {
    220227                DEBUG(5, ("server returned invalid read&x data offset\n"));
     
    681688 fail:
    682689        TALLOC_FREE(frame);
    683         if (!NT_STATUS_IS_OK(status)) {
    684                 cli_set_error(cli, status);
    685         }
    686690        return status;
    687691}
     
    704708                          cli_read_sink, &buf, &ret);
    705709        if (!NT_STATUS_IS_OK(status)) {
    706                 cli_set_error(cli, status);
    707710                return -1;
    708711        }
     
    812815        }
    813816
    814         size = MIN(size, max_write);
     817        state->size = MIN(size, max_write);
    815818
    816819        vwv = state->vwv;
     
    824827        SSVAL(vwv+7, 0, mode);
    825828        SSVAL(vwv+8, 0, 0);
    826         SSVAL(vwv+9, 0, (size>>16));
    827         SSVAL(vwv+10, 0, size);
     829        SSVAL(vwv+9, 0, (state->size>>16));
     830        SSVAL(vwv+10, 0, state->size);
    828831
    829832        SSVAL(vwv+11, 0,
     
    842845        state->iov[0].iov_len = 1;
    843846        state->iov[1].iov_base = CONST_DISCARD(void *, buf);
    844         state->iov[1].iov_len = size;
     847        state->iov[1].iov_len = state->size;
    845848
    846849        subreq = cli_smb_req_create(state, ev, cli, SMBwriteX, 0, wct, vwv,
     
    895898        }
    896899        state->written = SVAL(vwv+2, 0);
    897         state->written |= SVAL(vwv+4, 0)<<16;
     900        if (state->size > UINT16_MAX) {
     901                /*
     902                 * It is important that we only set the
     903                 * high bits only if we asked for a large write.
     904                 *
     905                 * OS/2 print shares get this wrong and may send
     906                 * invalid values.
     907                 *
     908                 * See bug #5326.
     909                 */
     910                state->written |= SVAL(vwv+4, 0)<<16;
     911        }
    898912        tevent_req_done(req);
    899913}
     
    10451059 fail:
    10461060        TALLOC_FREE(frame);
    1047         if (!NT_STATUS_IS_OK(status)) {
    1048                 cli_set_error(cli, status);
    1049         }
    10501061        return status;
    10511062}
     
    12771288 fail:
    12781289        TALLOC_FREE(frame);
    1279         if (!NT_STATUS_IS_OK(status)) {
    1280                 cli_set_error(cli, status);
    1281         }
    12821290        return status;
    12831291}
Note: See TracChangeset for help on using the changeset viewer.