summaryrefslogtreecommitdiffstats
path: root/source/client
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-05-14 14:01:47 +0000
committerGerald Carter <jerry@samba.org>2002-05-14 14:01:47 +0000
commitd3388d195308cf7fba83734424e78b5248786af5 (patch)
tree508a0990badde85f855d97f961a0b429e51cb276 /source/client
parent217ae50acd8cf088e268e7d2a6a7c192aca9e2f1 (diff)
downloadsamba-d3388d195308cf7fba83734424e78b5248786af5.tar.gz
samba-d3388d195308cf7fba83734424e78b5248786af5.tar.xz
samba-d3388d195308cf7fba83734424e78b5248786af5.zip
segfault fix merged from SAMBA_2_2
Diffstat (limited to 'source/client')
-rw-r--r--source/client/client.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/client/client.c b/source/client/client.c
index 1daba28b98e..0630bbb44b0 100644
--- a/source/client/client.c
+++ b/source/client/client.c
@@ -2080,6 +2080,14 @@ 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;
+ }
+
while (cmd[0] != '\0') {
char *p;
fstring tok;
@@ -2484,9 +2492,13 @@ handle a tar operation
static int do_tar_op(char *base_directory)
{
int ret;
- cli = do_connect(desthost, service);
- if (!cli)
- return 1;
+
+ /* do we already have a connection? */
+ if (!cli) {
+ cli = do_connect(desthost, service);
+ if (!cli)
+ return 1;
+ }
recurse=True;