summaryrefslogtreecommitdiff
path: root/source3/libsmb/clireadwrite.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-06-16 04:21:56 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-06-16 04:21:56 +0000
commit60ad5b69808c0ebfecd13c8f741f4e5687742899 (patch)
tree8669807f3753437a6ab007614ed2fc7dd125d92c /source3/libsmb/clireadwrite.c
parentba73192c3cec720656f65ede44f82d9e6027a9aa (diff)
downloadsamba-60ad5b69808c0ebfecd13c8f741f4e5687742899.tar.gz
samba-60ad5b69808c0ebfecd13c8f741f4e5687742899.tar.bz2
samba-60ad5b69808c0ebfecd13c8f741f4e5687742899.zip
Fix up some of the SMB signing code:
The problem was that *all* packets were being signed, even packets before signing was set up. (This broke the session request). This fixes it to be an 'opt in' measure - that is, we only attempt to sign things after we have got a valid, non-guest session setup as per the CIFS spec. I've not tested this against an MS server, becouse my VMware is down, but at least it doesn't break the build farm any more. Andrew Bartlett (This used to be commit 1dc5a8765876c1ca822e454651f8fd4a551965e9)
Diffstat (limited to 'source3/libsmb/clireadwrite.c')
-rw-r--r--source3/libsmb/clireadwrite.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 6fce1c039b..756a6cce2f 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -128,6 +128,11 @@ ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_
}
#if 0 /* relies on client_recieve_smb(), now a static in libsmb/clientgen.c */
+
+/* This call is INCOMPATIBLE with SMB signing. If you remove the #if 0
+ you must fix ensure you don't attempt to sign the packets - data
+ *will* be currupted */
+
/****************************************************************************
Issue a single SMBreadraw and don't wait for a reply.
****************************************************************************/
@@ -135,6 +140,12 @@ Issue a single SMBreadraw and don't wait for a reply.
static BOOL cli_issue_readraw(struct cli_state *cli, int fnum, off_t offset,
size_t size, int i)
{
+
+ if (!cli->sign_info.use_smb_signing) {
+ DEBUG(0, ("Cannot use readraw and SMB Signing\n"));
+ return False;
+ }
+
memset(cli->outbuf,'\0',smb_size);
memset(cli->inbuf,'\0',smb_size);