source: trunk/samba-3.0.25pre1/source/libsmb/clitrans.c@ 5

Last change on this file since 5 was 1, checked in by Paul Smedley, 18 years ago

Initial code import

File size: 18.9 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 client transaction calls
4 Copyright (C) Andrew Tridgell 1994-1998
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#include "includes.h"
22
23
24/****************************************************************************
25 Send a SMB trans or trans2 request.
26****************************************************************************/
27
28BOOL cli_send_trans(struct cli_state *cli, int trans,
29 const char *pipe_name,
30 int fid, int flags,
31 uint16 *setup, unsigned int lsetup, unsigned int msetup,
32 const char *param, unsigned int lparam, unsigned int mparam,
33 const char *data, unsigned int ldata, unsigned int mdata)
34{
35 unsigned int i;
36 unsigned int this_ldata,this_lparam;
37 unsigned int tot_data=0,tot_param=0;
38 char *outdata,*outparam;
39 char *p;
40 int pipe_name_len=0;
41 uint16 mid;
42
43 this_lparam = MIN(lparam,cli->max_xmit - (500+lsetup*2)); /* hack */
44 this_ldata = MIN(ldata,cli->max_xmit - (500+lsetup*2+this_lparam));
45
46 memset(cli->outbuf,'\0',smb_size);
47 set_message(cli->outbuf,14+lsetup,0,True);
48 SCVAL(cli->outbuf,smb_com,trans);
49 SSVAL(cli->outbuf,smb_tid, cli->cnum);
50 cli_setup_packet(cli);
51
52 /*
53 * Save the mid we're using. We need this for finding
54 * signing replies.
55 */
56
57 mid = cli->mid;
58
59 if (pipe_name) {
60 pipe_name_len = clistr_push(cli, smb_buf(cli->outbuf), pipe_name, -1, STR_TERMINATE);
61 }
62
63 outparam = smb_buf(cli->outbuf)+(trans==SMBtrans ? pipe_name_len : 3);
64 outdata = outparam+this_lparam;
65
66 /* primary request */
67 SSVAL(cli->outbuf,smb_tpscnt,lparam); /* tpscnt */
68 SSVAL(cli->outbuf,smb_tdscnt,ldata); /* tdscnt */
69 SSVAL(cli->outbuf,smb_mprcnt,mparam); /* mprcnt */
70 SSVAL(cli->outbuf,smb_mdrcnt,mdata); /* mdrcnt */
71 SCVAL(cli->outbuf,smb_msrcnt,msetup); /* msrcnt */
72 SSVAL(cli->outbuf,smb_flags,flags); /* flags */
73 SIVAL(cli->outbuf,smb_timeout,0); /* timeout */
74 SSVAL(cli->outbuf,smb_pscnt,this_lparam); /* pscnt */
75 SSVAL(cli->outbuf,smb_psoff,smb_offset(outparam,cli->outbuf)); /* psoff */
76 SSVAL(cli->outbuf,smb_dscnt,this_ldata); /* dscnt */
77 SSVAL(cli->outbuf,smb_dsoff,smb_offset(outdata,cli->outbuf)); /* dsoff */
78 SCVAL(cli->outbuf,smb_suwcnt,lsetup); /* suwcnt */
79 for (i=0;i<lsetup;i++) /* setup[] */
80 SSVAL(cli->outbuf,smb_setup+i*2,setup[i]);
81 p = smb_buf(cli->outbuf);
82 if (trans != SMBtrans) {
83 *p++ = 0; /* put in a null smb_name */
84 *p++ = 'D'; *p++ = ' '; /* observed in OS/2 */
85 }
86 if (this_lparam) /* param[] */
87 memcpy(outparam,param,this_lparam);
88 if (this_ldata) /* data[] */
89 memcpy(outdata,data,this_ldata);
90 cli_setup_bcc(cli, outdata+this_ldata);
91
92 show_msg(cli->outbuf);
93
94 if (!cli_send_smb(cli)) {
95 return False;
96 }
97
98 /* Note we're in a trans state. Save the sequence
99 * numbers for replies. */
100 client_set_trans_sign_state_on(cli, mid);
101
102 if (this_ldata < ldata || this_lparam < lparam) {
103 /* receive interim response */
104 if (!cli_receive_smb(cli) || cli_is_error(cli)) {
105 client_set_trans_sign_state_off(cli, mid);
106 return(False);
107 }
108
109 tot_data = this_ldata;
110 tot_param = this_lparam;
111
112 while (tot_data < ldata || tot_param < lparam) {
113 this_lparam = MIN(lparam-tot_param,cli->max_xmit - 500); /* hack */
114 this_ldata = MIN(ldata-tot_data,cli->max_xmit - (500+this_lparam));
115
116 set_message(cli->outbuf,trans==SMBtrans?8:9,0,True);
117 SCVAL(cli->outbuf,smb_com,(trans==SMBtrans ? SMBtranss : SMBtranss2));
118
119 outparam = smb_buf(cli->outbuf);
120 outdata = outparam+this_lparam;
121
122 /* secondary request */
123 SSVAL(cli->outbuf,smb_tpscnt,lparam); /* tpscnt */
124 SSVAL(cli->outbuf,smb_tdscnt,ldata); /* tdscnt */
125 SSVAL(cli->outbuf,smb_spscnt,this_lparam); /* pscnt */
126 SSVAL(cli->outbuf,smb_spsoff,smb_offset(outparam,cli->outbuf)); /* psoff */
127 SSVAL(cli->outbuf,smb_spsdisp,tot_param); /* psdisp */
128 SSVAL(cli->outbuf,smb_sdscnt,this_ldata); /* dscnt */
129 SSVAL(cli->outbuf,smb_sdsoff,smb_offset(outdata,cli->outbuf)); /* dsoff */
130 SSVAL(cli->outbuf,smb_sdsdisp,tot_data); /* dsdisp */
131 if (trans==SMBtrans2)
132 SSVALS(cli->outbuf,smb_sfid,fid); /* fid */
133 if (this_lparam) /* param[] */
134 memcpy(outparam,param+tot_param,this_lparam);
135 if (this_ldata) /* data[] */
136 memcpy(outdata,data+tot_data,this_ldata);
137 cli_setup_bcc(cli, outdata+this_ldata);
138
139 /*
140 * Save the mid we're using. We need this for finding
141 * signing replies.
142 */
143 mid = cli->mid;
144
145 show_msg(cli->outbuf);
146 if (!cli_send_smb(cli)) {
147 client_set_trans_sign_state_off(cli, mid);
148 return False;
149 }
150
151 /* Ensure we use the same mid for the secondaries. */
152 cli->mid = mid;
153
154 tot_data += this_ldata;
155 tot_param += this_lparam;
156 }
157 }
158
159 return(True);
160}
161
162/****************************************************************************
163 Receive a SMB trans or trans2 response allocating the necessary memory.
164****************************************************************************/
165
166BOOL cli_receive_trans(struct cli_state *cli,int trans,
167 char **param, unsigned int *param_len,
168 char **data, unsigned int *data_len)
169{
170 unsigned int total_data=0;
171 unsigned int total_param=0;
172 unsigned int this_data,this_param;
173 NTSTATUS status;
174 BOOL ret = False;
175
176 *data_len = *param_len = 0;
177
178 if (!cli_receive_smb(cli)) {
179 return False;
180 }
181
182 show_msg(cli->inbuf);
183
184 /* sanity check */
185 if (CVAL(cli->inbuf,smb_com) != trans) {
186 DEBUG(0,("Expected %s response, got command 0x%02x\n",
187 trans==SMBtrans?"SMBtrans":"SMBtrans2",
188 CVAL(cli->inbuf,smb_com)));
189 return False;
190 }
191
192 /*
193 * An NT RPC pipe call can return ERRDOS, ERRmoredata
194 * to a trans call. This is not an error and should not
195 * be treated as such. Note that STATUS_NO_MORE_FILES is
196 * returned when a trans2 findfirst/next finishes.
197 */
198 status = cli_nt_error(cli);
199
200 if (NT_STATUS_IS_ERR(status) || NT_STATUS_EQUAL(status,STATUS_NO_MORE_FILES)) {
201 goto out;
202 }
203
204 /* parse out the lengths */
205 total_data = SVAL(cli->inbuf,smb_tdrcnt);
206 total_param = SVAL(cli->inbuf,smb_tprcnt);
207
208 /* allocate it */
209 if (total_data!=0) {
210 *data = (char *)SMB_REALLOC(*data,total_data);
211 if (!(*data)) {
212 DEBUG(0,("cli_receive_trans: failed to enlarge data buffer\n"));
213 goto out;
214 }
215 }
216
217 if (total_param!=0) {
218 *param = (char *)SMB_REALLOC(*param,total_param);
219 if (!(*param)) {
220 DEBUG(0,("cli_receive_trans: failed to enlarge param buffer\n"));
221 goto out;
222 }
223 }
224
225 for (;;) {
226 this_data = SVAL(cli->inbuf,smb_drcnt);
227 this_param = SVAL(cli->inbuf,smb_prcnt);
228
229 if (this_data + *data_len > total_data ||
230 this_param + *param_len > total_param) {
231 DEBUG(1,("Data overflow in cli_receive_trans\n"));
232 goto out;
233 }
234
235 if (this_data + *data_len < this_data ||
236 this_data + *data_len < *data_len ||
237 this_param + *param_len < this_param ||
238 this_param + *param_len < *param_len) {
239 DEBUG(1,("Data overflow in cli_receive_trans\n"));
240 goto out;
241 }
242
243 if (this_data) {
244 unsigned int data_offset_out = SVAL(cli->inbuf,smb_drdisp);
245 unsigned int data_offset_in = SVAL(cli->inbuf,smb_droff);
246
247 if (data_offset_out > total_data ||
248 data_offset_out + this_data > total_data ||
249 data_offset_out + this_data < data_offset_out ||
250 data_offset_out + this_data < this_data) {
251 DEBUG(1,("Data overflow in cli_receive_trans\n"));
252 goto out;
253 }
254 if (data_offset_in > cli->bufsize ||
255 data_offset_in + this_data > cli->bufsize ||
256 data_offset_in + this_data < data_offset_in ||
257 data_offset_in + this_data < this_data) {
258 DEBUG(1,("Data overflow in cli_receive_trans\n"));
259 goto out;
260 }
261
262 memcpy(*data + data_offset_out, smb_base(cli->inbuf) + data_offset_in, this_data);
263 }
264 if (this_param) {
265 unsigned int param_offset_out = SVAL(cli->inbuf,smb_prdisp);
266 unsigned int param_offset_in = SVAL(cli->inbuf,smb_proff);
267
268 if (param_offset_out > total_param ||
269 param_offset_out + this_param > total_param ||
270 param_offset_out + this_param < param_offset_out ||
271 param_offset_out + this_param < this_param) {
272 DEBUG(1,("Param overflow in cli_receive_trans\n"));
273 goto out;
274 }
275 if (param_offset_in > cli->bufsize ||
276 param_offset_in + this_param > cli->bufsize ||
277 param_offset_in + this_param < param_offset_in ||
278 param_offset_in + this_param < this_param) {
279 DEBUG(1,("Param overflow in cli_receive_trans\n"));
280 goto out;
281 }
282
283 memcpy(*param + param_offset_out, smb_base(cli->inbuf) + param_offset_in, this_param);
284 }
285 *data_len += this_data;
286 *param_len += this_param;
287
288 if (total_data <= *data_len && total_param <= *param_len) {
289 ret = True;
290 break;
291 }
292
293 if (!cli_receive_smb(cli)) {
294 goto out;
295 }
296
297 show_msg(cli->inbuf);
298
299 /* sanity check */
300 if (CVAL(cli->inbuf,smb_com) != trans) {
301 DEBUG(0,("Expected %s response, got command 0x%02x\n",
302 trans==SMBtrans?"SMBtrans":"SMBtrans2",
303 CVAL(cli->inbuf,smb_com)));
304 goto out;
305 }
306 if (NT_STATUS_IS_ERR(cli_nt_error(cli))) {
307 goto out;
308 }
309
310 /* parse out the total lengths again - they can shrink! */
311 if (SVAL(cli->inbuf,smb_tdrcnt) < total_data)
312 total_data = SVAL(cli->inbuf,smb_tdrcnt);
313 if (SVAL(cli->inbuf,smb_tprcnt) < total_param)
314 total_param = SVAL(cli->inbuf,smb_tprcnt);
315
316 if (total_data <= *data_len && total_param <= *param_len) {
317 ret = True;
318 break;
319 }
320 }
321
322 out:
323
324 client_set_trans_sign_state_off(cli, SVAL(cli->inbuf,smb_mid));
325 return ret;
326}
327
328/****************************************************************************
329 Send a SMB nttrans request.
330****************************************************************************/
331
332BOOL cli_send_nt_trans(struct cli_state *cli,
333 int function,
334 int flags,
335 uint16 *setup, unsigned int lsetup, unsigned int msetup,
336 char *param, unsigned int lparam, unsigned int mparam,
337 char *data, unsigned int ldata, unsigned int mdata)
338{
339 unsigned int i;
340 unsigned int this_ldata,this_lparam;
341 unsigned int tot_data=0,tot_param=0;
342 uint16 mid;
343 char *outdata,*outparam;
344
345 this_lparam = MIN(lparam,cli->max_xmit - (500+lsetup*2)); /* hack */
346 this_ldata = MIN(ldata,cli->max_xmit - (500+lsetup*2+this_lparam));
347
348 memset(cli->outbuf,'\0',smb_size);
349 set_message(cli->outbuf,19+lsetup,0,True);
350 SCVAL(cli->outbuf,smb_com,SMBnttrans);
351 SSVAL(cli->outbuf,smb_tid, cli->cnum);
352 cli_setup_packet(cli);
353
354 /*
355 * Save the mid we're using. We need this for finding
356 * signing replies.
357 */
358
359 mid = cli->mid;
360
361 outparam = smb_buf(cli->outbuf)+3;
362 outdata = outparam+this_lparam;
363
364 /* primary request */
365 SCVAL(cli->outbuf,smb_nt_MaxSetupCount,msetup);
366 SCVAL(cli->outbuf,smb_nt_Flags,flags);
367 SIVAL(cli->outbuf,smb_nt_TotalParameterCount, lparam);
368 SIVAL(cli->outbuf,smb_nt_TotalDataCount, ldata);
369 SIVAL(cli->outbuf,smb_nt_MaxParameterCount, mparam);
370 SIVAL(cli->outbuf,smb_nt_MaxDataCount, mdata);
371 SIVAL(cli->outbuf,smb_nt_ParameterCount, this_lparam);
372 SIVAL(cli->outbuf,smb_nt_ParameterOffset, smb_offset(outparam,cli->outbuf));
373 SIVAL(cli->outbuf,smb_nt_DataCount, this_ldata);
374 SIVAL(cli->outbuf,smb_nt_DataOffset, smb_offset(outdata,cli->outbuf));
375 SIVAL(cli->outbuf,smb_nt_SetupCount, lsetup);
376 SIVAL(cli->outbuf,smb_nt_Function, function);
377 for (i=0;i<lsetup;i++) /* setup[] */
378 SSVAL(cli->outbuf,smb_nt_SetupStart+i*2,setup[i]);
379
380 if (this_lparam) /* param[] */
381 memcpy(outparam,param,this_lparam);
382 if (this_ldata) /* data[] */
383 memcpy(outdata,data,this_ldata);
384
385 cli_setup_bcc(cli, outdata+this_ldata);
386
387 show_msg(cli->outbuf);
388 if (!cli_send_smb(cli)) {
389 return False;
390 }
391
392 /* Note we're in a trans state. Save the sequence
393 * numbers for replies. */
394 client_set_trans_sign_state_on(cli, mid);
395
396 if (this_ldata < ldata || this_lparam < lparam) {
397 /* receive interim response */
398 if (!cli_receive_smb(cli) || cli_is_error(cli)) {
399 client_set_trans_sign_state_off(cli, mid);
400 return(False);
401 }
402
403 tot_data = this_ldata;
404 tot_param = this_lparam;
405
406 while (tot_data < ldata || tot_param < lparam) {
407 this_lparam = MIN(lparam-tot_param,cli->max_xmit - 500); /* hack */
408 this_ldata = MIN(ldata-tot_data,cli->max_xmit - (500+this_lparam));
409
410 set_message(cli->outbuf,18,0,True);
411 SCVAL(cli->outbuf,smb_com,SMBnttranss);
412
413 /* XXX - these should probably be aligned */
414 outparam = smb_buf(cli->outbuf);
415 outdata = outparam+this_lparam;
416
417 /* secondary request */
418 SIVAL(cli->outbuf,smb_nts_TotalParameterCount,lparam);
419 SIVAL(cli->outbuf,smb_nts_TotalDataCount,ldata);
420 SIVAL(cli->outbuf,smb_nts_ParameterCount,this_lparam);
421 SIVAL(cli->outbuf,smb_nts_ParameterOffset,smb_offset(outparam,cli->outbuf));
422 SIVAL(cli->outbuf,smb_nts_ParameterDisplacement,tot_param);
423 SIVAL(cli->outbuf,smb_nts_DataCount,this_ldata);
424 SIVAL(cli->outbuf,smb_nts_DataOffset,smb_offset(outdata,cli->outbuf));
425 SIVAL(cli->outbuf,smb_nts_DataDisplacement,tot_data);
426 if (this_lparam) /* param[] */
427 memcpy(outparam,param+tot_param,this_lparam);
428 if (this_ldata) /* data[] */
429 memcpy(outdata,data+tot_data,this_ldata);
430 cli_setup_bcc(cli, outdata+this_ldata);
431
432 /*
433 * Save the mid we're using. We need this for finding
434 * signing replies.
435 */
436 mid = cli->mid;
437
438 show_msg(cli->outbuf);
439
440 if (!cli_send_smb(cli)) {
441 client_set_trans_sign_state_off(cli, mid);
442 return False;
443 }
444
445 /* Ensure we use the same mid for the secondaries. */
446 cli->mid = mid;
447
448 tot_data += this_ldata;
449 tot_param += this_lparam;
450 }
451 }
452
453 return(True);
454}
455
456/****************************************************************************
457 Receive a SMB nttrans response allocating the necessary memory.
458****************************************************************************/
459
460BOOL cli_receive_nt_trans(struct cli_state *cli,
461 char **param, unsigned int *param_len,
462 char **data, unsigned int *data_len)
463{
464 unsigned int total_data=0;
465 unsigned int total_param=0;
466 unsigned int this_data,this_param;
467 uint8 eclass;
468 uint32 ecode;
469 BOOL ret = False;
470
471 *data_len = *param_len = 0;
472
473 if (!cli_receive_smb(cli)) {
474 return False;
475 }
476
477 show_msg(cli->inbuf);
478
479 /* sanity check */
480 if (CVAL(cli->inbuf,smb_com) != SMBnttrans) {
481 DEBUG(0,("Expected SMBnttrans response, got command 0x%02x\n",
482 CVAL(cli->inbuf,smb_com)));
483 return(False);
484 }
485
486 /*
487 * An NT RPC pipe call can return ERRDOS, ERRmoredata
488 * to a trans call. This is not an error and should not
489 * be treated as such.
490 */
491 if (cli_is_dos_error(cli)) {
492 cli_dos_error(cli, &eclass, &ecode);
493 if (!(eclass == ERRDOS && ecode == ERRmoredata)) {
494 goto out;
495 }
496 }
497
498 /*
499 * Likewise for NT_STATUS_BUFFER_TOO_SMALL
500 */
501 if (cli_is_nt_error(cli)) {
502 if (!NT_STATUS_EQUAL(cli_nt_error(cli),
503 NT_STATUS_BUFFER_TOO_SMALL)) {
504 goto out;
505 }
506 }
507
508 /* parse out the lengths */
509 total_data = SVAL(cli->inbuf,smb_ntr_TotalDataCount);
510 total_param = SVAL(cli->inbuf,smb_ntr_TotalParameterCount);
511
512 /* allocate it */
513 if (total_data) {
514 *data = (char *)SMB_REALLOC(*data,total_data);
515 if (!(*data)) {
516 DEBUG(0,("cli_receive_nt_trans: failed to enlarge data buffer to %d\n",total_data));
517 goto out;
518 }
519 }
520
521 if (total_param) {
522 *param = (char *)SMB_REALLOC(*param,total_param);
523 if (!(*param)) {
524 DEBUG(0,("cli_receive_nt_trans: failed to enlarge param buffer to %d\n", total_param));
525 goto out;
526 }
527 }
528
529 while (1) {
530 this_data = SVAL(cli->inbuf,smb_ntr_DataCount);
531 this_param = SVAL(cli->inbuf,smb_ntr_ParameterCount);
532
533 if (this_data + *data_len > total_data ||
534 this_param + *param_len > total_param) {
535 DEBUG(1,("Data overflow in cli_receive_nt_trans\n"));
536 goto out;
537 }
538
539 if (this_data + *data_len < this_data ||
540 this_data + *data_len < *data_len ||
541 this_param + *param_len < this_param ||
542 this_param + *param_len < *param_len) {
543 DEBUG(1,("Data overflow in cli_receive_nt_trans\n"));
544 goto out;
545 }
546
547 if (this_data) {
548 unsigned int data_offset_out = SVAL(cli->inbuf,smb_ntr_DataDisplacement);
549 unsigned int data_offset_in = SVAL(cli->inbuf,smb_ntr_DataOffset);
550
551 if (data_offset_out > total_data ||
552 data_offset_out + this_data > total_data ||
553 data_offset_out + this_data < data_offset_out ||
554 data_offset_out + this_data < this_data) {
555 DEBUG(1,("Data overflow in cli_receive_nt_trans\n"));
556 goto out;
557 }
558 if (data_offset_in > cli->bufsize ||
559 data_offset_in + this_data > cli->bufsize ||
560 data_offset_in + this_data < data_offset_in ||
561 data_offset_in + this_data < this_data) {
562 DEBUG(1,("Data overflow in cli_receive_nt_trans\n"));
563 goto out;
564 }
565
566 memcpy(*data + data_offset_out, smb_base(cli->inbuf) + data_offset_in, this_data);
567 }
568
569 if (this_param) {
570 unsigned int param_offset_out = SVAL(cli->inbuf,smb_ntr_ParameterDisplacement);
571 unsigned int param_offset_in = SVAL(cli->inbuf,smb_ntr_ParameterOffset);
572
573 if (param_offset_out > total_param ||
574 param_offset_out + this_param > total_param ||
575 param_offset_out + this_param < param_offset_out ||
576 param_offset_out + this_param < this_param) {
577 DEBUG(1,("Param overflow in cli_receive_nt_trans\n"));
578 goto out;
579 }
580 if (param_offset_in > cli->bufsize ||
581 param_offset_in + this_param > cli->bufsize ||
582 param_offset_in + this_param < param_offset_in ||
583 param_offset_in + this_param < this_param) {
584 DEBUG(1,("Param overflow in cli_receive_nt_trans\n"));
585 goto out;
586 }
587
588 memcpy(*param + param_offset_out, smb_base(cli->inbuf) + param_offset_in, this_param);
589 }
590
591 *data_len += this_data;
592 *param_len += this_param;
593
594 if (total_data <= *data_len && total_param <= *param_len) {
595 ret = True;
596 break;
597 }
598
599 if (!cli_receive_smb(cli)) {
600 goto out;
601 }
602
603 show_msg(cli->inbuf);
604
605 /* sanity check */
606 if (CVAL(cli->inbuf,smb_com) != SMBnttrans) {
607 DEBUG(0,("Expected SMBnttrans response, got command 0x%02x\n",
608 CVAL(cli->inbuf,smb_com)));
609 goto out;
610 }
611 if (cli_is_dos_error(cli)) {
612 cli_dos_error(cli, &eclass, &ecode);
613 if(!(eclass == ERRDOS && ecode == ERRmoredata)) {
614 goto out;
615 }
616 }
617 /*
618 * Likewise for NT_STATUS_BUFFER_TOO_SMALL
619 */
620 if (cli_is_nt_error(cli)) {
621 if (!NT_STATUS_EQUAL(cli_nt_error(cli),
622 NT_STATUS_BUFFER_TOO_SMALL)) {
623 goto out;
624 }
625 }
626
627 /* parse out the total lengths again - they can shrink! */
628 if (SVAL(cli->inbuf,smb_ntr_TotalDataCount) < total_data)
629 total_data = SVAL(cli->inbuf,smb_ntr_TotalDataCount);
630 if (SVAL(cli->inbuf,smb_ntr_TotalParameterCount) < total_param)
631 total_param = SVAL(cli->inbuf,smb_ntr_TotalParameterCount);
632
633 if (total_data <= *data_len && total_param <= *param_len) {
634 ret = True;
635 break;
636 }
637 }
638
639 out:
640
641 client_set_trans_sign_state_off(cli, SVAL(cli->inbuf,smb_mid));
642 return ret;
643}
Note: See TracBrowser for help on using the repository browser.