static int io_bufsize = 524288;
static int name_type = 0x20;
-extern int max_protocol;
+static int max_protocol = PROTOCOL_NT1;
static int process_tok(char *tok);
static int cmd_help(void);
return;
}
p = strrchr_m(mask2,CLI_DIRSEP_CHAR);
- if (!p) {
- TALLOC_FREE(dir);
- return;
+ if (p) {
+ p[1] = 0;
+ } else {
+ mask2[0] = '\0';
}
- p[1] = 0;
mask2 = talloc_asprintf_append(mask2,
"%s%s*",
f->name,
static int cmd_quit(void)
{
- cli_cm_shutdown();
+ cli_shutdown(cli);
exit(0);
/* NOTREACHED */
return 0;
}
if (f == x_stdin) {
- cli_cm_shutdown();
+ cli_shutdown(cli);
exit(0);
}
Free a file_list structure.
****************************************************************************/
-static void free_file_list (struct file_list *list_head)
+static void free_file_list (struct file_list *l_head)
{
struct file_list *list, *next;
- for (list = list_head; list; list = next) {
+ for (list = l_head; list; list = next) {
next = list->next;
- DLIST_REMOVE(list_head, list);
+ DLIST_REMOVE(l_head, list);
SAFE_FREE(list->file_path);
SAFE_FREE(list);
}
static int cmd_list_connect(void)
{
- cli_cm_display();
+ cli_cm_display(cli);
return 0;
}
if (!cli) {
cli = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : desthost,
- service, true, smb_encrypt);
+ service, true, smb_encrypt,
+ max_protocol, port, name_type);
if (!cli) {
return 1;
}
cli = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : desthost,
- service, true, smb_encrypt);
+ service, true, smb_encrypt,
+ max_protocol, port, name_type);
if (!cli) {
return 1;
}
if (base_directory && *base_directory) {
rc = do_cd(base_directory);
if (rc) {
- cli_cm_shutdown();
+ cli_shutdown(cli);
return rc;
}
}
process_stdin();
}
- cli_cm_shutdown();
+ cli_shutdown(cli);
return rc;
}
struct sockaddr_storage ss;
cli = cli_cm_open(talloc_tos(), NULL,
- query_host, "IPC$", true, smb_encrypt);
+ query_host, "IPC$", true, smb_encrypt,
+ max_protocol, port, name_type);
if (!cli)
return 1;
/* Workgroups simply don't make sense over anything
else but port 139... */
- cli_cm_shutdown();
- cli_cm_set_port( 139 );
+ cli_shutdown(cli);
cli = cli_cm_open(talloc_tos(), NULL,
- query_host, "IPC$", true, smb_encrypt);
+ query_host, "IPC$", true, smb_encrypt,
+ max_protocol, 139, name_type);
}
if (cli == NULL) {
list_servers(lp_workgroup());
- cli_cm_shutdown();
+ cli_shutdown(cli);
return(0);
}
if (!cli) {
cli = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : desthost,
- service, true, smb_encrypt);
+ service, true, smb_encrypt,
+ max_protocol, port, name_type);
if (!cli)
return 1;
}
if (base_directory && *base_directory) {
ret = do_cd(base_directory);
if (ret) {
- cli_cm_shutdown();
+ cli_shutdown(cli);
return ret;
}
}
ret=process_tar();
- cli_cm_shutdown();
+ cli_shutdown(cli);
return(ret);
}
msg_port = port ? port : 139;
- if (!(cli=cli_initialise()) || (cli_set_port(cli, msg_port) != msg_port)) {
+ if (!(cli=cli_initialise())) {
d_printf("Connection to %s failed\n", desthost);
return 1;
}
+ cli_set_port(cli, msg_port);
status = cli_connect(cli, server_name, &ss);
if (!NT_STATUS_IS_OK(status)) {
if (!cli_session_request(cli, &calling, &called)) {
d_printf("session request failed\n");
- cli_cm_shutdown();
+ cli_shutdown(cli);
return 1;
}
send_message(get_cmdline_auth_info_username(auth_info));
- cli_cm_shutdown();
+ cli_shutdown(cli);
return 0;
}
* to port 139 instead of port 445. srl,crh
*/
name_type = 0x03;
- cli_cm_set_dest_name_type( name_type );
desthost = talloc_strdup(frame,poptGetOptArg(pc));
if (!desthost) {
exit(ENOMEM);
}
if( !port )
- cli_cm_set_port( 139 );
+ port = 139;
message = true;
break;
case 'I':
poptGetArg(pc));
}
- /* check for the -P option */
-
- if ( port != 0 )
- cli_cm_set_port( port );
-
/*
* Don't load debug level from smb.conf. It should be
* set by cmdline arg or remain default (0)
cli_cm_set_credentials(auth_info);
- DEBUG(3,("Client started (version %s).\n", SAMBA_VERSION_STRING));
+ DEBUG(3,("Client started (version %s).\n", samba_version_string()));
if (tar_type) {
if (cmdstr)
*p = 0;
p++;
sscanf(p, "%x", &name_type);
- cli_cm_set_dest_name_type( name_type );
}
return do_host_query(qhost);