1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

smbd: Move check for SMB2 compound request to new function

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13047

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Christof Schmitt 2017-09-21 17:41:25 -07:00 committed by Jeremy Allison
parent 835f5068e3
commit cfa2c30830
3 changed files with 7 additions and 1 deletions

View File

@ -225,6 +225,7 @@ void smbd_server_connection_terminate_ex(struct smbXsrv_connection *xconn,
const char *smb2_opcode_name(uint16_t opcode);
bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size);
bool smbd_smb2_is_compound(const struct smbd_smb2_request *req);
NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd,
struct smbXsrv_connection **_xconn);

View File

@ -350,7 +350,7 @@ static NTSTATUS schedule_smb2_sendfile_read(struct smbd_smb2_request *smb2req,
if (!lp__use_sendfile(SNUM(fsp->conn)) ||
smb2req->do_signing ||
smb2req->do_encryption ||
smb2req->in.vector_count >= (2*SMBD_SMB2_NUM_IOV_PER_REQ) ||
smbd_smb2_is_compound(smb2req) ||
(fsp->base_fsp != NULL) ||
(fsp->wcp != NULL) ||
(!S_ISREG(fsp->fsp_name->st.st_ex_mode)) ||

View File

@ -204,6 +204,11 @@ bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size)
return true;
}
bool smbd_smb2_is_compound(const struct smbd_smb2_request *req)
{
return req->in.vector_count >= (2*SMBD_SMB2_NUM_IOV_PER_REQ);
}
static NTSTATUS smbd_initialize_smb2(struct smbXsrv_connection *xconn,
uint64_t expected_seq_low)
{