Index: libsmb/clientgen.c =================================================================== --- libsmb/clientgen.c (Revision 11970) +++ libsmb/clientgen.c (Arbeitskopie) @@ -495,3 +495,34 @@ } return True; } + +/**************************************************************************** + Send/receive a SMBecho command: ping the server +****************************************************************************/ +BOOL cli_echo(struct cli_state *cli, DATA_BLOB data) +{ + char *p; + + SMB_ASSERT(data.length < 1024); + + memset(cli->outbuf,'\0',smb_size); + set_message(cli->outbuf,1,data.length,True); + SCVAL(cli->outbuf,smb_com,SMBecho); + SSVAL(cli->outbuf,smb_tid,65535); + SSVAL(cli->outbuf,smb_vwv0,1); + cli_setup_packet(cli); + p = smb_buf(cli->outbuf); + memcpy(p, data.data, data.length); + p += data.length; + + cli_setup_bcc(cli, p); + + cli_send_smb(cli); + if (!cli_receive_smb(cli)) { + return False; + } + + if (cli_is_error(cli)) return False; + + return True; +} Index: client/client.c =================================================================== --- client/client.c (Revision 11970) +++ client/client.c (Arbeitskopie) @@ -31,6 +31,7 @@ extern BOOL override_logfile; extern char tar_type; extern BOOL in_client; +extern int smb_read_error; static int port = 0; pstring cur_dir = "\\"; static pstring cd_path = ""; @@ -3087,8 +3088,17 @@ receive_smb(cli->fd,cli->inbuf,0); goto again; } - - cli_chkpath(cli, "\\"); + + { + DATA_BLOB garbage = data_blob(NULL, 16); + if (garbage.data == NULL) { + DEBUG(0, ("malloc failed\n")); + return; + } + generate_random_buffer(garbage.data, garbage.length); + cli_echo(cli, garbage); + data_blob_free(&garbage); + } } /****************************************************************************