Ignore:
Timestamp:
Nov 29, 2012, 1:59:04 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/smbd/smb2_negprot.c

    r745 r751  
    6262NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
    6363{
     64
    6465        const uint8_t *inbody;
    6566        const uint8_t *indyn = NULL;
     
    7071        uint16_t security_offset;
    7172        DATA_BLOB security_buffer;
    72         size_t expected_body_size = 0x24;
    73         size_t body_size;
    7473        size_t expected_dyn_size = 0;
    7574        size_t c;
     
    7877        uint16_t dialect = 0;
    7978        uint32_t capabilities;
     79
     80
     81
     82
    8083
    81 /* TODO: drop the connection with INVALID_PARAMETER */
    82 
    83         if (req->in.vector[i+1].iov_len != (expected_body_size & 0xFFFFFFFE)) {
    84                 return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
     84        status = smbd_smb2_request_verify_sizes(req, 0x24);
     85        if (!NT_STATUS_IS_OK(status)) {
     86                return smbd_smb2_request_error(req, status);
    8587        }
    86 
    8788        inbody = (const uint8_t *)req->in.vector[i+1].iov_base;
    88 
    89         body_size = SVAL(inbody, 0x00);
    90         if (body_size != expected_body_size) {
    91                 return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
    92         }
    9389
    9490        dialect_count = SVAL(inbody, 0x02);
     
    140136        }
    141137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
    142148        security_offset = SMB2_HDR_BODY + 0x40;
    143149
     
    165171        SIVAL(outbody.data, 0x18,
    166172              capabilities);                    /* capabilities */
    167         SIVAL(outbody.data, 0x1C, lp_smb2_max_trans()); /* max transact size */
    168         SIVAL(outbody.data, 0x20, lp_smb2_max_read());  /* max read size */
    169         SIVAL(outbody.data, 0x24, lp_smb2_max_write()); /* max write size */
     173        SIVAL(outbody.data, 0x1C, );   /* max transact size */
     174        SIVAL(outbody.data, 0x20, );   /* max read size */
     175        SIVAL(outbody.data, 0x24, );   /* max write size */
    170176        SBVAL(outbody.data, 0x28, 0);           /* system time */
    171177        SBVAL(outbody.data, 0x30, 0);           /* server start time */
     
    179185
    180186        req->sconn->using_smb2 = true;
     187
     188
     189
    181190
    182191        return smbd_smb2_request_done(req, outbody, &outdyn);
Note: See TracChangeset for help on using the changeset viewer.