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

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/smbd/smb2_notify.c

    r414 r745  
    44
    55   Copyright (C) Stefan Metzmacher 2009
     6   Copyright (C) Jeremy Allison 2010
    67
    78   This program is free software; you can redistribute it and/or modify
     
    2021
    2122#include "includes.h"
     23#include "smbd/smbd.h"
    2224#include "smbd/globals.h"
    2325#include "../libcli/smb/smb_common.h"
     26#include "../lib/util/tevent_ntstatus.h"
     27
     28struct smbd_smb2_notify_state {
     29        struct smbd_smb2_request *smb2req;
     30        struct smb_request *smbreq;
     31        struct tevent_immediate *im;
     32        NTSTATUS status;
     33        DATA_BLOB out_output_buffer;
     34};
    2435
    2536static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx,
     
    7182         * Windows 2008 uses 0x00080000
    7283         */
    73         if (in_output_buffer_length > 0x00010000) {
     84        if (in_output_buffer_length > lp_smb2_max_trans()) {
    7485                return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
    7586        }
     
    7788        if (req->compat_chain_fsp) {
    7889                /* skip check */
    79         } else if (in_file_id_persistent != 0) {
     90        } else if (in_file_id_persistent != in_file_id_volatile) {
    8091                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
    8192        }
     
    109120        NTSTATUS error; /* transport error */
    110121
     122        if (req->cancelled) {
     123                struct smbd_smb2_notify_state *state = tevent_req_data(subreq,
     124                                               struct smbd_smb2_notify_state);
     125                const uint8_t *inhdr = (const uint8_t *)req->in.vector[i].iov_base;
     126                uint64_t mid = BVAL(inhdr, SMB2_HDR_MESSAGE_ID);
     127
     128                DEBUG(10,("smbd_smb2_request_notify_done: cancelled mid %llu\n",
     129                        (unsigned long long)mid ));
     130                error = smbd_smb2_request_error(req, NT_STATUS_CANCELLED);
     131                if (!NT_STATUS_IS_OK(error)) {
     132                        smbd_server_connection_terminate(req->sconn,
     133                                nt_errstr(error));
     134                        return;
     135                }
     136                TALLOC_FREE(state->im);
     137                return;
     138        }
     139
    111140        status = smbd_smb2_notify_recv(subreq,
    112141                                       req,
     
    154183}
    155184
    156 struct smbd_smb2_notify_state {
    157         struct smbd_smb2_request *smb2req;
    158         struct smb_request *smbreq;
    159         struct tevent_immediate *im;
    160         NTSTATUS status;
    161         DATA_BLOB out_output_buffer;
    162 };
    163 
    164185static void smbd_smb2_notify_reply(struct smb_request *smbreq,
    165186                                   NTSTATUS error_code,
     
    265286                 */
    266287
    267                 change_notify_reply(fsp->conn, smbreq,
     288                change_notify_reply(smbreq,
    268289                                    NT_STATUS_OK,
    269290                                    in_output_buffer_length,
     
    362383                                               struct smbd_smb2_notify_state);
    363384
    364         smbd_notify_cancel_by_smbreq(state->smb2req->sconn,
    365                                      state->smbreq);
    366 
     385        smbd_notify_cancel_by_smbreq(state->smbreq);
     386
     387        state->smb2req->cancelled = true;
     388        tevent_req_done(req);
    367389        return true;
    368390}
Note: See TracChangeset for help on using the changeset viewer.