s3: Fix chained sesssetupAndX/tconn messages
authorTim Prouty <tprouty@samba.org>
Wed, 25 Mar 2009 00:24:55 +0000 (00:24 +0000)
committerJeremy Allison <jra@samba.org>
Sat, 9 May 2009 00:09:16 +0000 (17:09 -0700)
A sesssetupAndX chained with a tconn will not correctly set the TID in
the response header.  I'm seeing an XP client send this chained
sesssetup/tconn when samba has security = share.  Samba's current
behavior is to return a TID of 0 in the smb header rather than the
actual TID.  This patch also updates the UID in the header as well.

source3/smbd/process.c

index 487358d701dc492f18355d324fa343d7f27c59ee..0647b99ba022df931ce268e36fce5f960c285611 100644 (file)
@@ -1617,6 +1617,13 @@ void chain_reply(struct smb_request *req)
                }
                req->outbuf = NULL;
        } else {
+               /*
+                * Update smb headers where subsequent chained commands
+                * may have updated them.
+                */
+               SCVAL(req->chain_outbuf, smb_tid, CVAL(req->outbuf, smb_tid));
+               SCVAL(req->chain_outbuf, smb_uid, CVAL(req->outbuf, smb_uid));
+
                if (!smb_splice_chain(&req->chain_outbuf,
                                      CVAL(req->outbuf, smb_com),
                                      CVAL(req->outbuf, smb_wct),