Index: client/client.c =================================================================== --- client/client.c (revision 6344) +++ client/client.c (working copy) @@ -260,6 +260,7 @@ struct cli_state *targetcli; SMB_STRUCT_STAT sbuf; uint32 attributes; + int ret = 1; dos_format(newdir); @@ -305,21 +306,23 @@ pstrcpy(cur_dir,saved_dir); goto out; } - } - else { + } else { pstrcat( targetpath, "\\" ); dos_clean_name( targetpath ); if ( !cli_chkpath(targetcli, targetpath) ) { d_printf("cd %s: %s\n", dname, cli_errstr(targetcli)); pstrcpy(cur_dir,saved_dir); + goto out; } } + ret = 0; + out: + pstrcpy(cd_path,cur_dir); - - return 0; + return ret; } /**************************************************************************** @@ -3170,7 +3173,13 @@ return 1; } - if (*base_directory) do_cd(base_directory); + if (*base_directory) { + rc = do_cd(base_directory); + if (rc) { + cli_cm_shutdown(); + return rc; + } + } if (cmdstr) { rc = process_command_string(cmdstr); @@ -3233,7 +3242,13 @@ recurse=True; - if (*base_directory) do_cd(base_directory); + if (*base_directory) { + ret = do_cd(base_directory); + if (ret) { + cli_cm_shutdown(); + return ret; + } + } ret=process_tar();