diff options
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r-- | source4/libcli/raw/rawacl.c | 2 | ||||
-rw-r--r-- | source4/libcli/raw/rawfileinfo.c | 4 | ||||
-rw-r--r-- | source4/libcli/raw/rawfsinfo.c | 2 | ||||
-rw-r--r-- | source4/libcli/raw/rawsearch.c | 8 | ||||
-rw-r--r-- | source4/libcli/raw/rawtrans.c | 12 |
5 files changed, 20 insertions, 8 deletions
diff --git a/source4/libcli/raw/rawacl.c b/source4/libcli/raw/rawacl.c index 20e6d6df31..9b4f2db3b2 100644 --- a/source4/libcli/raw/rawacl.c +++ b/source4/libcli/raw/rawacl.c @@ -31,7 +31,7 @@ struct smbcli_request *smb_raw_query_secdesc_send(struct smbcli_tree *tree, nt.in.max_setup = 0; nt.in.max_param = 4; - nt.in.max_data = 0x10000; + nt.in.max_data = smb_raw_max_trans_data(tree, 4); nt.in.setup_count = 0; nt.in.function = NT_TRANSACT_QUERY_SECURITY_DESC; nt.in.setup = NULL; diff --git a/source4/libcli/raw/rawfileinfo.c b/source4/libcli/raw/rawfileinfo.c index cbb666b7ce..a0ee7891bf 100644 --- a/source4/libcli/raw/rawfileinfo.c +++ b/source4/libcli/raw/rawfileinfo.c @@ -291,7 +291,7 @@ static struct smbcli_request *smb_raw_fileinfo_blob_send(struct smbcli_tree *tre tp.in.setup_count = 1; tp.in.data = data_blob(NULL, 0); tp.in.max_param = 2; - tp.in.max_data = 0xFFFF; + tp.in.max_data = smb_raw_max_trans_data(tree, 2); tp.in.setup = &setup; tp.in.params = data_blob_talloc(mem_ctx, NULL, 4); @@ -344,7 +344,7 @@ static struct smbcli_request *smb_raw_pathinfo_blob_send(struct smbcli_tree *tre tp.in.setup_count = 1; tp.in.data = data_blob(NULL, 0); tp.in.max_param = 2; - tp.in.max_data = 0xFFFF; + tp.in.max_data = smb_raw_max_trans_data(tree, 2); tp.in.setup = &setup; tp.in.params = data_blob_talloc(mem_ctx, NULL, 6); diff --git a/source4/libcli/raw/rawfsinfo.c b/source4/libcli/raw/rawfsinfo.c index aefe8e3085..49378887fa 100644 --- a/source4/libcli/raw/rawfsinfo.c +++ b/source4/libcli/raw/rawfsinfo.c @@ -77,7 +77,7 @@ static struct smbcli_request *smb_raw_qfsinfo_send(struct smbcli_tree *tree, tp.in.timeout = 0; tp.in.setup_count = 1; tp.in.max_param = 0; - tp.in.max_data = 0x1000; /* plenty for all possible QFS levels */ + tp.in.max_data = smb_raw_max_trans_data(tree, 0); tp.in.setup = &setup; tp.in.data = data_blob(NULL, 0); tp.in.timeout = 0; diff --git a/source4/libcli/raw/rawsearch.c b/source4/libcli/raw/rawsearch.c index dd8904dfd1..120a42f0d6 100644 --- a/source4/libcli/raw/rawsearch.c +++ b/source4/libcli/raw/rawsearch.c @@ -206,8 +206,8 @@ static NTSTATUS smb_raw_search_first_blob(struct smbcli_tree *tree, tp.in.timeout = 0; tp.in.setup_count = 1; tp.in.data = data_blob(NULL, 0); - tp.in.max_param = 1024; - tp.in.max_data = 8192; + tp.in.max_param = 10; + tp.in.max_data = smb_raw_max_trans_data(tree, 10); tp.in.setup = &setup; tp.in.params = data_blob_talloc(mem_ctx, NULL, 12); @@ -258,8 +258,8 @@ static NTSTATUS smb_raw_search_next_blob(struct smbcli_tree *tree, tp.in.timeout = 0; tp.in.setup_count = 1; tp.in.data = data_blob(NULL, 0); - tp.in.max_param = 1024; - tp.in.max_data = 8192; + tp.in.max_param = 10; + tp.in.max_data = smb_raw_max_trans_data(tree, 10); tp.in.setup = &setup; tp.in.params = data_blob_talloc(mem_ctx, NULL, 12); diff --git a/source4/libcli/raw/rawtrans.c b/source4/libcli/raw/rawtrans.c index e6c928e3ed..21e20d00e0 100644 --- a/source4/libcli/raw/rawtrans.c +++ b/source4/libcli/raw/rawtrans.c @@ -531,3 +531,15 @@ NTSTATUS smb_raw_nttrans(struct smbcli_tree *tree, return smb_raw_nttrans_recv(req, mem_ctx, parms); } + +/* + work out the maximum data size for a trans request while avoiding + multi-part replies + + TODO: we only need to avoid multi-part replies because the + multi-part trans receive code is broken. +*/ +size_t smb_raw_max_trans_data(struct smbcli_tree *tree, size_t param_size) +{ + return tree->session->transport->options.max_xmit - (70 + param_size); +} |