From 25521c90859de0651216c459273b2ffd916ee299 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Aug 2013 11:45:43 -0700 Subject: Remove restrictions on setting iosize inside smbclient for SMB2 connections. Also remove the SMB1 restriction to minimum iosize of 16384 (0x4000): Now values >= 0 and <= 0xFFFF00 can be set for SMB1, 0 meaning server defined behaviour. 0 is the new default for iosize, both for SMB1 and SMB2. Signed-off-by: Jeremy Allison Reviewed-by: Michael Adam --- source3/client/client.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'source3/client') diff --git a/source3/client/client.c b/source3/client/client.c index d302d43925..ad4a87547e 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -4528,29 +4528,35 @@ int cmd_iosize(void) int iosize; if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) { - if (!smb_encrypt) { - d_printf("iosize or iosize 0x. " - "Minimum is 16384 (0x4000), " - "max is 16776960 (0xFFFF00)\n"); + if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) { + if (!smb_encrypt) { + d_printf("iosize or iosize 0x. " + "Minimum is 0 (default), " + "max is 16776960 (0xFFFF00)\n"); + } else { + d_printf("iosize or iosize 0x. " + "(Encrypted connection) ," + "Minimum is 0 (default), " + "max is 130048 (0x1FC00)\n"); + } } else { - d_printf("iosize or iosize 0x. " - "(Encrypted connection) ," - "Minimum is 16384 (0x4000), " - "max is 130048 (0x1FC00)\n"); + d_printf("iosize or iosize 0x.\n"); } return 1; } iosize = strtol(buf,NULL,0); - if (smb_encrypt && (iosize < 0x4000 || iosize > 0xFC00)) { - d_printf("iosize out of range for encrypted " - "connection (min = 16384 (0x4000), " - "max = 130048 (0x1FC00)"); - return 1; - } else if (!smb_encrypt && (iosize < 0x4000 || iosize > 0xFFFF00)) { - d_printf("iosize out of range (min = 16384 (0x4000), " - "max = 16776960 (0xFFFF00)"); - return 1; + if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) { + if (smb_encrypt && (iosize < 0 || iosize > 0xFC00)) { + d_printf("iosize out of range for encrypted " + "connection (min = 0 (default), " + "max = 130048 (0x1FC00)"); + return 1; + } else if (!smb_encrypt && (iosize < 0 || iosize > 0xFFFF00)) { + d_printf("iosize out of range (min = 0 (default), " + "max = 16776960 (0xFFFF00)"); + return 1; + } } io_bufsize = iosize; -- cgit