From 9c410118cb8b53a6a7194b6768f433cac056e4d2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 6 Apr 2010 15:43:35 -0700 Subject: Parameterize "smb2 max read", "smb2 max write", "smb2 max trans". Set to 64k by default. Jeremy. --- source3/smbd/smb2_negprot.c | 6 +++--- source3/smbd/smb2_notify.c | 2 +- source3/smbd/smb2_read.c | 4 ++-- source3/smbd/smb2_write.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c index 5b97c65d79..5a216b27e4 100644 --- a/source3/smbd/smb2_negprot.c +++ b/source3/smbd/smb2_negprot.c @@ -164,9 +164,9 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req) negprot_spnego_blob.data, 16); /* server guid */ SIVAL(outbody.data, 0x18, capabilities); /* capabilities */ - SIVAL(outbody.data, 0x1C, 0x00010000); /* max transact size */ - SIVAL(outbody.data, 0x20, 0x00010000); /* max read size */ - SIVAL(outbody.data, 0x24, 0x00010000); /* max write size */ + SIVAL(outbody.data, 0x1C, lp_smb2_max_trans()); /* max transact size */ + SIVAL(outbody.data, 0x20, lp_smb2_max_read()); /* max read size */ + SIVAL(outbody.data, 0x24, lp_smb2_max_write()); /* max write size */ SBVAL(outbody.data, 0x28, 0); /* system time */ SBVAL(outbody.data, 0x30, 0); /* server start time */ SSVAL(outbody.data, 0x38, diff --git a/source3/smbd/smb2_notify.c b/source3/smbd/smb2_notify.c index fb465abff9..8fa0744319 100644 --- a/source3/smbd/smb2_notify.c +++ b/source3/smbd/smb2_notify.c @@ -70,7 +70,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 > 0x00010000) { + if (in_output_buffer_length > lp_smb2_max_trans()) { return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); } diff --git a/source3/smbd/smb2_read.c b/source3/smbd/smb2_read.c index 674fa2b71f..aa2805d66a 100644 --- a/source3/smbd/smb2_read.c +++ b/source3/smbd/smb2_read.c @@ -75,9 +75,9 @@ 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 > 0x00010000) { + if (in_length > lp_smb2_max_read()) { DEBUG(0,("here:%s: 0x%08X: 0x%08X\n", - __location__, in_length, 0x00010000)); + __location__, in_length, lp_smb2_max_read())); return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); } diff --git a/source3/smbd/smb2_write.c b/source3/smbd/smb2_write.c index 17d562affa..608cf09e45 100644 --- a/source3/smbd/smb2_write.c +++ b/source3/smbd/smb2_write.c @@ -81,9 +81,9 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req) } /* check the max write size */ - if (in_data_length > 0x00010000) { + if (in_data_length > lp_smb2_max_write()) { DEBUG(0,("here:%s: 0x%08X: 0x%08X\n", - __location__, in_data_length, 0x00010000)); + __location__, in_data_length, lp_smb2_max_write())); return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); } -- cgit