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

    r745 r751  
    455455                                        p_unread, &len);
    456456        if (!NT_STATUS_IS_OK(status)) {
    457                 DEBUG(1, ("read_smb_length_return_keepalive failed for "
    458                           "client %s read error = %s.\n",
    459                           sconn->client_id.addr, nt_errstr(status)));
     457                DEBUG(NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)?5:1,
     458                      ("receive_smb_raw_talloc failed for client %s "
     459                       "read error = %s.\n",
     460                       sconn->client_id.addr, nt_errstr(status)));
    460461                return status;
    461462        }
     
    14451446        /* Make sure this is an SMB packet. smb_size contains NetBIOS header
    14461447         * so subtract 4 from it. */
    1447         if (!valid_smb_header(req->inbuf)
    1448             || (size < (smb_size - 4))) {
     1448        if ((size < (smb_size - 4)) ||
     1449            !valid_smb_header(req->inbuf)) {
    14491450                DEBUG(2,("Non-SMB packet of length %d. Terminating server\n",
    14501451                         smb_len(req->inbuf)));
     
    20922093
    20932094        /*
    2094          * Check if the client tries to fool us. The request so far uses the
    2095          * space to the end of the byte buffer in the request just
    2096          * processed. The chain_offset can't point into that area. If that was
    2097          * the case, we could end up with an endless processing of the chain,
    2098          * we would always handle the same request.
     2095         * Check if the client tries to fool us. The chain offset
     2096         * needs to point beyond the current request in the chain, it
     2097         * needs to strictly grow. Otherwise we might be tricked into
     2098         * an endless loop always processing the same request over and
     2099         * over again. We used to assume that vwv and the byte buffer
     2100         * array in a chain are always attached, but OS/2 the
     2101         * Write&X/Read&X chain puts the Read&X vwv array right behind
     2102         * the Write&X vwv chain. The Write&X bcc array is put behind
     2103         * the Read&X vwv array. So now we check whether the chain
     2104         * offset points strictly behind the previous vwv
     2105         * array. req->buf points right after the vwv array of the
     2106         * previous request. See
     2107         * https://bugzilla.samba.org/show_bug.cgi?id=8360 for more
     2108         * information.
    20992109         */
    21002110
    2101         already_used = PTR_DIFF(req->buf+req->buflen, smb_base(req->inbuf));
    2102         if (chain_offset < already_used) {
     2111        already_used = PTR_DIFF(req->buf, smb_base(req->inbuf));
     2112        if (chain_offset <= already_used) {
    21032113                goto error;
    21042114        }
     
    28012811 * Handle SMBecho requests in a forked child process
    28022812 */
    2803 static bool fork_echo_handler(struct smbd_server_connection *sconn)
     2813bool fork_echo_handler(struct smbd_server_connection *sconn)
    28042814{
    28052815        int listener_pipe[2];
     
    29152925        int ret;
    29162926
    2917         if (lp_maxprotocol() == PROTOCOL_SMB2 &&
    2918             !lp_async_smb_echo_handler()) {
     2927        if (lp_maxprotocol() == PROTOCOL_SMB2) {
    29192928                /*
    29202929                 * We're not making the decision here,
     
    30373046        }
    30383047
    3039         if (lp_async_smb_echo_handler() && !fork_echo_handler(sconn)) {
    3040                 exit_server("Failed to fork echo handler");
    3041         }
    3042 
    30433048        /* Setup oplocks */
    30443049        if (!init_oplocks(sconn->msg_ctx))
Note: See TracChangeset for help on using the changeset viewer.