diff options
Diffstat (limited to 'source3/client/client.c')
-rw-r--r-- | source3/client/client.c | 58 |
1 files changed, 22 insertions, 36 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index a421f36d80..1daba28b98 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -22,7 +22,7 @@ #define NO_SYSLOG #include "includes.h" -#include "../client/client_proto.h" + #ifndef REGISTER #define REGISTER 0 #endif @@ -34,7 +34,7 @@ extern BOOL in_client; extern BOOL AllowDebugChange; static int port = 0; pstring cur_dir = "\\"; -static pstring cd_path = ""; +pstring cd_path = ""; static pstring service; static pstring desthost; extern pstring global_myname; @@ -61,9 +61,9 @@ static int cmd_help(void); #define FID_UNUSED (0xFFFF) time_t newer_than = 0; -static int archive_level = 0; +int archive_level = 0; -static BOOL translation = False; +BOOL translation = False; static BOOL have_ip; @@ -74,39 +74,36 @@ extern BOOL tar_reset; /* clitar bits end */ -static mode_t myumask = 0755; +mode_t myumask = 0755; -static BOOL prompt = True; +BOOL prompt = True; -static int printmode = 1; +int printmode = 1; static BOOL recurse = False; BOOL lowercase = False; -static struct in_addr dest_ip; +struct in_addr dest_ip; #define SEPARATORS " \t\n\r" -static BOOL abort_mget = True; +BOOL abort_mget = True; -static pstring fileselection = ""; +pstring fileselection = ""; extern file_info def_finfo; /* timing globals */ int get_total_size = 0; int get_total_time_ms = 0; -static int put_total_size = 0; -static int put_total_time_ms = 0; +int put_total_size = 0; +int put_total_time_ms = 0; /* totals globals */ static double dir_total; #define USENMB -/* some forward declarations */ -static struct cli_state *do_connect(const char *server, const char *share); - /**************************************************************************** write to a local file with CR/LF->LF translation if appropriate. return the number taken from the buffer. This may not equal the number written. @@ -1123,10 +1120,7 @@ static int do_put(char *rname,char *lname) } - if (f != x_stdin) { - x_fclose(f); - } - + x_fclose(f); SAFE_FREE(buf); { @@ -1964,7 +1958,7 @@ static BOOL list_servers(char *wk_grp) * field is NULL, and NULL in that field is used in process_tok() * (below) to indicate the end of the list. crh */ -static struct +struct { char *name; int (*fn)(void); @@ -2086,14 +2080,6 @@ static int process_command_string(char *cmd) char *ptr; int rc = 0; - /* establish the connection if not already */ - - if (!cli) { - cli = do_connect(desthost, service); - if (!cli) - return 0; - } - while (cmd[0] != '\0') { char *p; fstring tok; @@ -2244,7 +2230,7 @@ static void process_stdin(void) /***************************************************** return a connection to a server *******************************************************/ -static struct cli_state *do_connect(const char *server, const char *share) +struct cli_state *do_connect(const char *server, const char *share) { struct cli_state *c; struct nmb_name called, calling; @@ -2498,13 +2484,9 @@ handle a tar operation static int do_tar_op(char *base_directory) { int ret; - - /* do we already have a connection? */ - if (!cli) { - cli = do_connect(desthost, service); - if (!cli) - return 1; - } + cli = do_connect(desthost, service); + if (!cli) + return 1; recurse=True; @@ -2641,6 +2623,10 @@ static void remember_query_host(const char *arg, } DEBUGLEVEL = old_debug; +#ifdef WITH_SSL + sslutil_init(0); +#endif + pstrcpy(workgroup,lp_workgroup()); load_interfaces(); |