diff options
author | Steve French <smfrench@gmail.com> | 2008-01-05 14:51:23 -0600 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2008-01-05 14:51:23 -0600 |
commit | 56a8ef0bbb6abfd3bc81439a159a9bc41779495a (patch) | |
tree | ce04b61f82f25417639bbb29942433b2b2654530 /source3/client | |
parent | 8122eb767a83cd5f070ee99abae037c2a30c43e9 (diff) | |
parent | 4a413e4bd177402a1697cffac43d35e94cc55102 (diff) | |
download | samba-56a8ef0bbb6abfd3bc81439a159a9bc41779495a.tar.gz samba-56a8ef0bbb6abfd3bc81439a159a9bc41779495a.tar.bz2 samba-56a8ef0bbb6abfd3bc81439a159a9bc41779495a.zip |
Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-test
(This used to be commit d3b91e494c824a65506ba1bc1cba5bba77000530)
Diffstat (limited to 'source3/client')
-rw-r--r-- | source3/client/client.c | 16 | ||||
-rw-r--r-- | source3/client/smbspool.c | 21 |
2 files changed, 31 insertions, 6 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index 2a86035cf0..46f056021e 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -3798,7 +3798,7 @@ int cmd_iosize(void) d_printf("iosize <n> or iosize 0x<n>. " "(Encrypted connection) ," "Minimum is 16384 (0x4000), " - "max is 64512 (0xFC00)\n"); + "max is 130048 (0x1FC00)\n"); } return 1; } @@ -3807,7 +3807,7 @@ int cmd_iosize(void) if (smb_encrypt && (iosize < 0x4000 || iosize > 0xFC00)) { d_printf("iosize out of range for encrypted " "connection (min = 16384 (0x4000), " - "max = 64512 (0xFC00)"); + "max = 130048 (0x1FC00)"); return 1; } else if (!smb_encrypt && (iosize < 0x4000 || iosize > 0xFFFF00)) { d_printf("iosize out of range (min = 16384 (0x4000), " @@ -4328,16 +4328,22 @@ static void readline_callback(void) timeout.tv_usec = 0; sys_select_intr(cli->fd+1,&fds,NULL,NULL,&timeout); - /* We deliberately use receive_smb instead of + /* We deliberately use receive_smb_raw instead of client_receive_smb as we want to receive session keepalives and then drop them here. */ if (FD_ISSET(cli->fd,&fds)) { - if (!receive_smb(cli->fd,cli->inbuf,0,&cli->smb_rw_error)) { + if (receive_smb_raw(cli->fd,cli->inbuf,0,0,&cli->smb_rw_error) == -1) { DEBUG(0, ("Read from server failed, maybe it closed the " "connection\n")); return; } + if(CVAL(cli->inbuf,0) != SMBkeepalive) { + DEBUG(0, ("Read from server " + "returned unexpected packet!\n")); + return; + } + goto again; } @@ -4592,7 +4598,6 @@ static int do_message_op(void) { "port", 'p', POPT_ARG_INT, &port, 'p', "Port to connect to", "PORT" }, { "grepable", 'g', POPT_ARG_NONE, NULL, 'g', "Produce grepable output" }, { "browse", 'B', POPT_ARG_NONE, NULL, 'B', "Browse SMB servers using DNS" }, - { "encrypt", 'e', POPT_ARG_NONE, NULL, 'e', "Encrypt SMB transport (UNIX extended servers only)" }, POPT_COMMON_SAMBA POPT_COMMON_CONNECTION POPT_COMMON_CREDENTIALS @@ -4828,6 +4833,7 @@ static int do_message_op(void) calling_name = talloc_strdup(frame, global_myname() ); } + smb_encrypt = get_cmdline_auth_info_smb_encrypt(); init_names(); if(new_name_resolve_order) diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c index 4270eb4272..e7df22c2bc 100644 --- a/source3/client/smbspool.c +++ b/source3/client/smbspool.c @@ -47,7 +47,9 @@ static struct cli_state *smb_complete_connection(const char *, const char *,int static struct cli_state *smb_connect(const char *, const char *, int, const char *, const char *, const char *, const char *); static int smb_print(struct cli_state *, char *, FILE *); static char * uri_unescape_alloc(const char *); - +#if 0 +static bool smb_encrypt; +#endif /* * 'main()' - Main entry for SMB backend. @@ -468,6 +470,23 @@ static struct cli_state return NULL; } +#if 0 + /* Need to work out how to specify this on the URL. */ + if (smb_encrypt) + { + if (!cli_cm_force_encryption(cli, + username, + password, + workgroup, + share)) + { + fprintf(stderr, "ERROR: encryption setup failed\n"); + cli_shutdown(cli); + return NULL; + } + } +#endif + return cli; } |