1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3:smb2_server: use xconn->smb2.server.max_* instead of sconn->smb2.max_*

We don't need this twice...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Stefan Metzmacher 2014-05-23 10:22:34 +02:00 committed by Michael Adam
parent ce76a40956
commit e79b011434
8 changed files with 19 additions and 20 deletions

View File

@ -839,9 +839,6 @@ struct smbd_server_connection {
*/
struct bitmap *credits_bitmap;
bool supports_multicredit;
uint32_t max_trans;
uint32_t max_read;
uint32_t max_write;
} smb2;
/*

View File

@ -207,6 +207,7 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
uint32_t in_output_buffer_length,
const char *in_file_name)
{
struct smbXsrv_connection *xconn = smb2req->sconn->conn;
struct tevent_req *req;
struct smbd_smb2_find_state *state;
struct smb_request *smbreq;
@ -273,11 +274,11 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
if (in_output_buffer_length > smb2req->sconn->smb2.max_trans) {
if (in_output_buffer_length > xconn->smb2.server.max_trans) {
DEBUG(2,("smbd_smb2_find_send: "
"client ignored max trans:%s: 0x%08X: 0x%08X\n",
__location__, in_output_buffer_length,
smb2req->sconn->smb2.max_trans));
xconn->smb2.server.max_trans));
tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
return tevent_req_post(req, ev);
}

View File

@ -44,6 +44,7 @@ static NTSTATUS smbd_smb2_getinfo_recv(struct tevent_req *req,
static void smbd_smb2_request_getinfo_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_getinfo(struct smbd_smb2_request *req)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
NTSTATUS status;
const uint8_t *inbody;
uint8_t in_info_type;
@ -90,18 +91,18 @@ NTSTATUS smbd_smb2_request_process_getinfo(struct smbd_smb2_request *req)
in_input_buffer.data = SMBD_SMB2_IN_DYN_PTR(req);
in_input_buffer.length = in_input_buffer_length;
if (in_input_buffer.length > req->sconn->smb2.max_trans) {
if (in_input_buffer.length > xconn->smb2.server.max_trans) {
DEBUG(2,("smbd_smb2_request_process_getinfo: "
"client ignored max trans: %s: 0x%08X: 0x%08X\n",
__location__, (unsigned)in_input_buffer.length,
(unsigned)req->sconn->smb2.max_trans));
(unsigned)xconn->smb2.server.max_trans));
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}
if (in_output_buffer_length > req->sconn->smb2.max_trans) {
if (in_output_buffer_length > xconn->smb2.server.max_trans) {
DEBUG(2,("smbd_smb2_request_process_getinfo: "
"client ignored max trans: %s: 0x%08X: 0x%08X\n",
__location__, in_output_buffer_length,
req->sconn->smb2.max_trans));
xconn->smb2.server.max_trans));
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}

View File

@ -394,10 +394,6 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
conn->smb2.server.max_trans = max_trans;
conn->smb2.server.max_read = max_read;
conn->smb2.server.max_write = max_write;
req->sconn->smb2.max_trans = max_trans;
req->sconn->smb2.max_read = max_read;
req->sconn->smb2.max_write = max_write;
}
return smbd_smb2_request_done(req, outbody, &outdyn);

View File

@ -48,6 +48,7 @@ static NTSTATUS smbd_smb2_notify_recv(struct tevent_req *req,
static void smbd_smb2_request_notify_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
NTSTATUS status;
const uint8_t *inbody;
uint16_t in_flags;
@ -74,7 +75,7 @@ NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req)
* 0x00010000 is what Windows 7 uses,
* Windows 2008 uses 0x00080000
*/
if (in_output_buffer_length > req->sconn->smb2.max_trans) {
if (in_output_buffer_length > xconn->smb2.server.max_trans) {
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}

View File

@ -43,6 +43,7 @@ static NTSTATUS smbd_smb2_read_recv(struct tevent_req *req,
static void smbd_smb2_request_read_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
NTSTATUS status;
const uint8_t *inbody;
uint32_t in_length;
@ -68,10 +69,10 @@ NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req)
in_remaining_bytes = IVAL(inbody, 0x28);
/* check the max read size */
if (in_length > req->sconn->smb2.max_read) {
if (in_length > xconn->smb2.server.max_read) {
DEBUG(2,("smbd_smb2_request_process_read: "
"client ignored max read: %s: 0x%08X: 0x%08X\n",
__location__, in_length, req->sconn->smb2.max_read));
__location__, in_length, xconn->smb2.server.max_read));
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}

View File

@ -39,6 +39,7 @@ static NTSTATUS smbd_smb2_setinfo_recv(struct tevent_req *req);
static void smbd_smb2_request_setinfo_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_setinfo(struct smbd_smb2_request *req)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
NTSTATUS status;
const uint8_t *inbody;
uint8_t in_info_type;
@ -81,11 +82,11 @@ NTSTATUS smbd_smb2_request_process_setinfo(struct smbd_smb2_request *req)
in_input_buffer.data = SMBD_SMB2_IN_DYN_PTR(req);
in_input_buffer.length = in_input_buffer_length;
if (in_input_buffer.length > req->sconn->smb2.max_trans) {
if (in_input_buffer.length > xconn->smb2.server.max_trans) {
DEBUG(2,("smbd_smb2_request_process_setinfo: "
"client ignored max trans: %s: 0x%08X: 0x%08X\n",
__location__, (unsigned)in_input_buffer.length,
(unsigned)req->sconn->smb2.max_trans));
(unsigned)xconn->smb2.server.max_trans));
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}

View File

@ -38,6 +38,7 @@ static NTSTATUS smbd_smb2_write_recv(struct tevent_req *req,
static void smbd_smb2_request_write_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
NTSTATUS status;
const uint8_t *inbody;
uint16_t in_data_offset;
@ -82,10 +83,10 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req)
}
/* check the max write size */
if (in_data_length > req->sconn->smb2.max_write) {
if (in_data_length > xconn->smb2.server.max_write) {
DEBUG(2,("smbd_smb2_request_process_write : "
"client ignored max write :%s: 0x%08X: 0x%08X\n",
__location__, in_data_length, req->sconn->smb2.max_write));
__location__, in_data_length, xconn->smb2.server.max_write));
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}