From 9f3062d8a7abd904cf75da58553bdd34bc106e56 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 3 Aug 2007 14:33:38 +0000 Subject: r24160: process_trans2 in smbd/blocking.c used send_trans2_replies. Fake a struct smb_request here. Volker (This used to be commit f712d1c92bee024a165b5facabdac1e2c866d9b1) --- source3/smbd/blocking.c | 17 +++++++++++------ source3/smbd/trans2.c | 12 ++++++------ 2 files changed, 17 insertions(+), 12 deletions(-) (limited to 'source3') diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c index c6e174ae22..1a0a988ea7 100644 --- a/source3/smbd/blocking.c +++ b/source3/smbd/blocking.c @@ -511,8 +511,7 @@ Waiting....\n", static BOOL process_trans2(blocking_lock_record *blr) { - char *inbuf = blr->inbuf; - char *outbuf; + struct smb_request *req; char params[2]; NTSTATUS status; struct byte_range_lock *br_lck = do_lock(smbd_messaging_context(), @@ -541,12 +540,18 @@ static BOOL process_trans2(blocking_lock_record *blr) } /* We finally got the lock, return success. */ - outbuf = get_OutBuffer(); - construct_reply_common(inbuf, outbuf); - SCVAL(outbuf,smb_com,SMBtrans2); + + if (!(req = talloc(tmp_talloc_ctx(), struct smb_request))) { + blocking_lock_reply_error(blr, NT_STATUS_NO_MEMORY); + return True; + } + + init_smb_request(req, (uint8 *)blr->inbuf); + + SCVAL(req->inbuf, smb_com, SMBtrans2); SSVAL(params,0,0); /* Fake up max_data_bytes here - we know it fits. */ - send_trans2_replies(inbuf, outbuf, max_send, params, 2, NULL, 0, 0xffff); + send_trans2_replies_new(req, params, 2, NULL, 0, 0xffff); return True; } diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 577524dedd..be4754ac08 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -735,12 +735,12 @@ int send_trans2_replies(const char *inbuf, return 0; } -static void send_trans2_replies_new(struct smb_request *req, - const char *params, - int paramsize, - const char *pdata, - int datasize, - int max_data_bytes) +void send_trans2_replies_new(struct smb_request *req, + const char *params, + int paramsize, + const char *pdata, + int datasize, + int max_data_bytes) { char *inbuf, *outbuf; int length, bufsize; -- cgit