From 4e73a3c0feb47c761fdcded9e6c2ac6d32534d9b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 10 Oct 2003 05:40:32 +0000 Subject: fixed snprintf.c for systems that have only some of the *printf() family of functions cope with servers that return bogus (too large) values in max_xmit cope with a couple more error conditions in RAW-SFILEINFO better startup time heuristics in NBENCH (This used to be commit 89f7261ba589e5760b3cf9c3594eab9d7198dd7e) --- source4/libcli/clireadwrite.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/libcli') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index e1d154b283..1e6c0fc064 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -42,6 +42,7 @@ ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_ * rounded down to a multiple of 1024. */ readsize = (cli->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) & ~1023; + if (readsize > 0xFFFF) readsize = 0xFFFF; while (total < size) { NTSTATUS status; @@ -91,6 +92,9 @@ ssize_t cli_write(struct cli_state *cli, return 0; } + if (block > 0xFFFF) block = 0xFFFF; + + parms.writex.level = RAW_WRITE_WRITEX; parms.writex.in.fnum = fnum; parms.writex.in.wmode = write_mode; @@ -133,6 +137,7 @@ ssize_t cli_smbwrite(struct cli_state *cli, do { size_t size = MIN(size1, cli->transport->negotiate.max_xmit - 48); + if (size > 0xFFFF) size = 0xFFFF; parms.write.in.fnum = fnum; parms.write.in.offset = offset; -- cgit