summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_sesssetup.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-04-17 21:20:17 -0700
committerJeremy Allison <jra@samba.org>2010-04-17 21:20:17 -0700
commitbf45b4f4fda2c4e0d697bb30720c780325c3cd84 (patch)
tree4e6bcc149469832e1126972cfcc8f0a24069e20e /source3/smbd/smb2_sesssetup.c
parente0d6f1a6dafef712c90a5df21fa42791e5c9b140 (diff)
downloadsamba-bf45b4f4fda2c4e0d697bb30720c780325c3cd84.tar.gz
samba-bf45b4f4fda2c4e0d697bb30720c780325c3cd84.tar.bz2
samba-bf45b4f4fda2c4e0d697bb30720c780325c3cd84.zip
First part of fix for bug #7331 - Compound async SMB 2 requests don't work right.
Gets us handling SMB2 compound async requests similar to W2K8R2 (and triggers the same client bug in the Win7 redirector). Great thanks to Ira Cooper <samba@ira.wakeful.net> for helping with this and to Metze for the wonderful async framework. The one thing I need to fix to make us identical to W2K8R2 is that when a compound request goes async at the end W2K8R2 splits the replies up into a compound non-async reply followed by a separate async reply. Currently we're doing the whole thing in a compound reply. Jeremy.
Diffstat (limited to 'source3/smbd/smb2_sesssetup.c')
-rw-r--r--source3/smbd/smb2_sesssetup.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index b3ea3fae9f..c79a443892 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -349,16 +349,23 @@ NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req)
in_session_id = BVAL(inhdr, SMB2_HDR_SESSION_ID);
- if (i > 2 && in_session_id == (0xFFFFFFFFFFFFFFFFLL)) {
- /*
- * Chained request - fill in session_id from
- * the previous request out.vector[].iov_base.
- * We can't modify the inhdr here as we have
- * yet to check signing.
- */
- outhdr = (const uint8_t *)req->out.vector[i-3].iov_base;
- in_session_id = BVAL(outhdr, SMB2_HDR_SESSION_ID);
- chained_fixup = true;
+ if (in_session_id == (0xFFFFFFFFFFFFFFFFLL)) {
+ if (req->async) {
+ /*
+ * async request - fill in session_id from
+ * already setup request out.vector[].iov_base.
+ */
+ outhdr = (const uint8_t *)req->out.vector[i].iov_base;
+ in_session_id = BVAL(outhdr, SMB2_HDR_SESSION_ID);
+ } else if (i > 2) {
+ /*
+ * Chained request - fill in session_id from
+ * the previous request out.vector[].iov_base.
+ */
+ outhdr = (const uint8_t *)req->out.vector[i-3].iov_base;
+ in_session_id = BVAL(outhdr, SMB2_HDR_SESSION_ID);
+ chained_fixup = true;
+ }
}
/* lookup an existing session */