summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-04-19 22:40:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:30 -0500
commit0829e1ad1c3646efecf50729f493b9ee72ef0517 (patch)
treefe0ee36b774cdd89a13745fd34be495cd5b4ed83 /source3/lib
parent36da6cb5847df2754e8f9223e0784da6013c572b (diff)
downloadsamba-0829e1ad1c3646efecf50729f493b9ee72ef0517.tar.gz
samba-0829e1ad1c3646efecf50729f493b9ee72ef0517.tar.bz2
samba-0829e1ad1c3646efecf50729f493b9ee72ef0517.zip
r22391: Looks bigger than it is. Make "inbuf" available
to all callers of smb_setlen (via set_message() calls). This will allow the server to reflect back the correct encryption context. Jeremy. (This used to be commit 2d80a96120a5fe2fe726f00746d36d85044c4bdb)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index bb92466a05..a9065816cf 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -533,7 +533,7 @@ void smb_set_enclen(char *buf,int len,uint16 enc_ctx_num)
Set the length and marker of an smb packet.
********************************************************************/
-void smb_setlen(char *buf,int len,const char *frombuf)
+void smb_setlen(const char *frombuf, char *buf, int len)
{
_smb_setlen(buf,len);
@@ -553,14 +553,14 @@ void smb_setlen(char *buf,int len,const char *frombuf)
Setup the word count and byte count for a smb message.
********************************************************************/
-int set_message(char *buf,int num_words,int num_bytes,BOOL zero)
+int set_message(const char *frombuf, char *buf,int num_words,int num_bytes,BOOL zero)
{
if (zero && (num_words || num_bytes)) {
memset(buf + smb_size,'\0',num_words*2 + num_bytes);
}
SCVAL(buf,smb_wct,num_words);
SSVAL(buf,smb_vwv + num_words*SIZEOFWORD,num_bytes);
- smb_setlen(buf,smb_size + num_words*2 + num_bytes - 4, NULL);
+ smb_setlen(frombuf, buf,smb_size + num_words*2 + num_bytes - 4);
return (smb_size + num_words*2 + num_bytes);
}
@@ -568,11 +568,11 @@ int set_message(char *buf,int num_words,int num_bytes,BOOL zero)
Setup only the byte count for a smb message.
********************************************************************/
-int set_message_bcc(char *buf,int num_bytes)
+int set_message_bcc(const char *frombuf, char *buf,int num_bytes)
{
int num_words = CVAL(buf,smb_wct);
SSVAL(buf,smb_vwv + num_words*SIZEOFWORD,num_bytes);
- smb_setlen(buf,smb_size + num_words*2 + num_bytes - 4, NULL);
+ smb_setlen(frombuf, buf,smb_size + num_words*2 + num_bytes - 4);
return (smb_size + num_words*2 + num_bytes);
}
@@ -581,9 +581,11 @@ int set_message_bcc(char *buf,int num_bytes)
message as a marker.
********************************************************************/
-int set_message_end(void *outbuf,void *end_ptr)
+int set_message_end(const char *frombuf, void *outbuf,void *end_ptr)
{
- return set_message_bcc((char *)outbuf,PTR_DIFF(end_ptr,smb_buf((char *)outbuf)));
+ return set_message_bcc(frombuf,
+ (char *)outbuf,
+ PTR_DIFF(end_ptr,smb_buf((char *)outbuf)));
}
/*******************************************************************