From 6c935f95b3d4aaf0922c5a7baf59c1e8224c019a Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Wed, 25 Mar 2009 00:24:55 +0000 Subject: [PATCH] s3: Fix chained sesssetupAndX/tconn messages 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 487358d701dc..0647b99ba022 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -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), -- 2.34.1