summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-08-16 11:45:43 -0700
committerMichael Adam <obnox@samba.org>2013-08-21 17:28:54 +0200
commit25521c90859de0651216c459273b2ffd916ee299 (patch)
treeaf5a0c4ce91c733d410b8bff76b43f903f2caba2
parent6e82f70da089964994fcb179c40bdc8275be2da9 (diff)
downloadsamba-25521c90859de0651216c459273b2ffd916ee299.tar.gz
samba-25521c90859de0651216c459273b2ffd916ee299.tar.bz2
samba-25521c90859de0651216c459273b2ffd916ee299.zip
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 <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--source3/client/client.c40
1 files changed, 23 insertions, 17 deletions
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 <n> or iosize 0x<n>. "
- "Minimum is 16384 (0x4000), "
- "max is 16776960 (0xFFFF00)\n");
+ if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
+ if (!smb_encrypt) {
+ d_printf("iosize <n> or iosize 0x<n>. "
+ "Minimum is 0 (default), "
+ "max is 16776960 (0xFFFF00)\n");
+ } else {
+ d_printf("iosize <n> or iosize 0x<n>. "
+ "(Encrypted connection) ,"
+ "Minimum is 0 (default), "
+ "max is 130048 (0x1FC00)\n");
+ }
} else {
- d_printf("iosize <n> or iosize 0x<n>. "
- "(Encrypted connection) ,"
- "Minimum is 16384 (0x4000), "
- "max is 130048 (0x1FC00)\n");
+ d_printf("iosize <n> or iosize 0x<n>.\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;