summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-07-26 17:58:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:00:16 -0500
commita344155b8d89869fa82594868b9a6952f53d9631 (patch)
tree6f508b5c8d5ef8a81c8ab0823cc5d88102c0d1b9
parent7fb9e6a860b47eaf82589b0ebbcd34dbd6ed5df4 (diff)
downloadsamba-a344155b8d89869fa82594868b9a6952f53d9631.tar.gz
samba-a344155b8d89869fa82594868b9a6952f53d9631.tar.bz2
samba-a344155b8d89869fa82594868b9a6952f53d9631.zip
r8782: Fix bug #2918. The problem was using Inbuffer to push a deferred open message onto the queue
when we're in a chained message set - we're actually processing a different buffer then. Added current_inbuf as a static inside smbd/process.c to ensure the correct message gets pushed and processed. Jeremy. (This used to be commit ccef7581717bff6145ffc386d5be24d6f42634cb)
-rw-r--r--source3/smbd/process.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 94d4b8d903..897bd56ba7 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -29,6 +29,7 @@ struct timeval smb_last_time;
static char *InBuffer = NULL;
static char *OutBuffer = NULL;
+static char *current_inbuf = NULL;
/*
* Size of data we can send to client. Set
@@ -245,12 +246,12 @@ struct pending_message_list *get_open_deferred_message(uint16 mid)
/****************************************************************************
Function to push a sharing violation open smb message onto a linked list of local smb messages ready
- for processing.
+ for processing. We must use current_inbuf here not Inbuf in case we're in a chained message set.
****************************************************************************/
BOOL push_sharing_violation_open_smb_message(struct timeval *ptv, char *private_data, size_t priv_len)
{
- uint16 mid = SVAL(InBuffer,smb_mid);
+ uint16 mid = SVAL(current_inbuf,smb_mid);
struct timeval tv;
SMB_BIG_INT tdif;
@@ -270,11 +271,11 @@ BOOL push_sharing_violation_open_smb_message(struct timeval *ptv, char *private_
tv.tv_usec = tdif % 1000000;
DEBUG(10,("push_sharing_violation_open_smb_message: pushing message len %u mid %u\
- timeout time [%u.%06u]\n", (unsigned int) smb_len(InBuffer)+4, (unsigned int)mid,
+ timeout time [%u.%06u]\n", (unsigned int) smb_len(current_inbuf)+4, (unsigned int)mid,
(unsigned int)tv.tv_sec, (unsigned int)tv.tv_usec));
- return push_queued_message(SHARE_VIOLATION_QUEUE, InBuffer,
- smb_len(InBuffer)+4, &tv, private_data, priv_len);
+ return push_queued_message(SHARE_VIOLATION_QUEUE, current_inbuf,
+ smb_len(current_inbuf)+4, &tv, private_data, priv_len);
}
/****************************************************************************
@@ -986,6 +987,7 @@ static int switch_message(int type,char *inbuf,char *outbuf,int size,int bufsize
!check_access(smbd_server_fd(), lp_hostsallow(-1), lp_hostsdeny(-1))))
return(ERROR_DOS(ERRSRV,ERRaccess));
+ current_inbuf = inbuf; /* In case we need to defer this message in open... */
outsize = smb_messages[type].fn(conn, inbuf,outbuf,size,bufsize);
}