The Samba-Bugzilla – Attachment 1603 Details for
Bug 3293
Change smbclient to issue smbecho instead of checkpath
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
look (text/plain), 1.79 KB, created by
Jeremy Allison
on 2005-11-30 10:39:42 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2005-11-30 10:39:42 UTC
Size:
1.79 KB
patch
obsolete
>Index: libsmb/clientgen.c >=================================================================== >--- libsmb/clientgen.c (revision 11975) >+++ libsmb/clientgen.c (working copy) >@@ -481,6 +481,7 @@ > /**************************************************************************** > Send a keepalive packet to the server > ****************************************************************************/ >+ > BOOL cli_send_keepalive(struct cli_state *cli) > { > if (cli->fd == -1) { >@@ -495,3 +496,36 @@ > } > return True; > } >+ >+/**************************************************************************** >+ Send/receive a SMBecho command: ping the server >+****************************************************************************/ >+ >+BOOL cli_echo(struct cli_state *cli, unsigned char *data, size_t length) >+{ >+ char *p; >+ >+ SMB_ASSERT(length < 1024); >+ >+ memset(cli->outbuf,'\0',smb_size); >+ set_message(cli->outbuf,1,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, length); >+ p += 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 11975) >+++ client/client.c (working copy) >@@ -3088,7 +3088,12 @@ > goto again; > } > >- cli_chkpath(cli, "\\"); >+ /* Ping the server to keep the connection alive using SMBecho. */ >+ { >+ unsigned char garbage[16]; >+ memset(garbage, 0xf0, sizeof(garbage)); >+ cli_echo(cli, garbage, sizeof(garbage)); >+ } > } > > /****************************************************************************
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 3293
:
1602
| 1603