2 Unix SMB/CIFS implementation.
3 Inter-process communication and named pipe handling
4 Copyright (C) Andrew Tridgell 1992-1998
7 Copyright (C) John H Terpstra 1995-1998
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 This file handles the named pipe and mailslot calls
24 in the SMBtrans protocol
31 #define NERR_notsupported 50
33 static void api_no_reply(connection_struct
*conn
, struct smb_request
*req
);
35 /*******************************************************************
36 copies parameters and data, as needed, into the smb buffer
38 *both* the data and params sections should be aligned. this
39 is fudged in the rpc pipes by
40 at present, only the data section is. this may be a possible
41 cause of some of the ipc problems being experienced. lkcl26dec97
43 ******************************************************************/
45 static void copy_trans_params_and_data(char *outbuf
, int align
,
46 char *rparam
, int param_offset
, int param_len
,
47 char *rdata
, int data_offset
, int data_len
)
49 char *copy_into
= smb_buf(outbuf
);
57 DEBUG(5,("copy_trans_params_and_data: params[%d..%d] data[%d..%d] (align %d)\n",
58 param_offset
, param_offset
+ param_len
,
59 data_offset
, data_offset
+ data_len
,
67 memcpy(copy_into
, &rparam
[param_offset
], param_len
);
69 copy_into
+= param_len
;
71 memset(copy_into
, '\0', align
);
77 memcpy(copy_into
, &rdata
[data_offset
], data_len
);
80 /****************************************************************************
82 ****************************************************************************/
84 void send_trans_reply(connection_struct
*conn
, const uint8_t *inbuf
,
85 char *rparam
, int rparam_len
,
86 char *rdata
, int rdata_len
,
87 bool buffer_too_large
)
89 int this_ldata
,this_lparam
;
90 int tot_data_sent
= 0;
91 int tot_param_sent
= 0;
95 int ldata
= rdata
? rdata_len
: 0;
96 int lparam
= rparam
? rparam_len
: 0;
99 DEBUG(5,("send_trans_reply: buffer %d too large\n", ldata
));
101 this_lparam
= MIN(lparam
,max_send
- 500); /* hack */
102 this_ldata
= MIN(ldata
,max_send
- (500+this_lparam
));
104 align
= ((this_lparam
)%4);
106 if (!create_outbuf(talloc_tos(), (char *)inbuf
, &outbuf
,
107 10, 1+align
+this_ldata
+this_lparam
)) {
108 smb_panic("could not allocate outbuf");
111 copy_trans_params_and_data(outbuf
, align
,
112 rparam
, tot_param_sent
, this_lparam
,
113 rdata
, tot_data_sent
, this_ldata
);
115 SSVAL(outbuf
,smb_vwv0
,lparam
);
116 SSVAL(outbuf
,smb_vwv1
,ldata
);
117 SSVAL(outbuf
,smb_vwv3
,this_lparam
);
118 SSVAL(outbuf
,smb_vwv4
,smb_offset(smb_buf(outbuf
)+1,outbuf
));
119 SSVAL(outbuf
,smb_vwv5
,0);
120 SSVAL(outbuf
,smb_vwv6
,this_ldata
);
121 SSVAL(outbuf
,smb_vwv7
,smb_offset(smb_buf(outbuf
)+1+this_lparam
+align
,
123 SSVAL(outbuf
,smb_vwv8
,0);
124 SSVAL(outbuf
,smb_vwv9
,0);
126 if (buffer_too_large
) {
127 error_packet_set((char *)outbuf
, ERRDOS
, ERRmoredata
,
128 STATUS_BUFFER_OVERFLOW
, __LINE__
, __FILE__
);
132 if (!srv_send_smb(smbd_server_fd(), (char *)outbuf
,
133 IS_CONN_ENCRYPTED(conn
))) {
134 exit_server_cleanly("send_trans_reply: srv_send_smb failed.");
139 tot_data_sent
= this_ldata
;
140 tot_param_sent
= this_lparam
;
142 while (tot_data_sent
< ldata
|| tot_param_sent
< lparam
)
144 this_lparam
= MIN(lparam
-tot_param_sent
,
145 max_send
- 500); /* hack */
146 this_ldata
= MIN(ldata
-tot_data_sent
,
147 max_send
- (500+this_lparam
));
155 align
= (this_lparam
%4);
157 if (!create_outbuf(talloc_tos(), (char *)inbuf
, &outbuf
,
158 10, 1+align
+this_ldata
+this_lparam
)) {
159 smb_panic("could not allocate outbuf");
162 copy_trans_params_and_data(outbuf
, align
,
163 rparam
, tot_param_sent
, this_lparam
,
164 rdata
, tot_data_sent
, this_ldata
);
166 SSVAL(outbuf
,smb_vwv0
,lparam
);
167 SSVAL(outbuf
,smb_vwv1
,ldata
);
169 SSVAL(outbuf
,smb_vwv3
,this_lparam
);
170 SSVAL(outbuf
,smb_vwv4
,smb_offset(smb_buf(outbuf
)+1,outbuf
));
171 SSVAL(outbuf
,smb_vwv5
,tot_param_sent
);
172 SSVAL(outbuf
,smb_vwv6
,this_ldata
);
173 SSVAL(outbuf
,smb_vwv7
,
174 smb_offset(smb_buf(outbuf
)+1+this_lparam
+align
, outbuf
));
175 SSVAL(outbuf
,smb_vwv8
,tot_data_sent
);
176 SSVAL(outbuf
,smb_vwv9
,0);
178 if (buffer_too_large
) {
179 error_packet_set(outbuf
, ERRDOS
, ERRmoredata
,
180 STATUS_BUFFER_OVERFLOW
,
185 if (!srv_send_smb(smbd_server_fd(), outbuf
,
186 IS_CONN_ENCRYPTED(conn
)))
187 exit_server_cleanly("send_trans_reply: srv_send_smb "
190 tot_data_sent
+= this_ldata
;
191 tot_param_sent
+= this_lparam
;
196 /****************************************************************************
197 Start the first part of an RPC reply which began with an SMBtrans request.
198 ****************************************************************************/
200 static void api_rpc_trans_reply(connection_struct
*conn
, struct smb_request
*req
, smb_np_struct
*p
)
202 bool is_data_outstanding
;
203 char *rdata
= (char *)SMB_MALLOC(p
->max_trans_reply
);
207 DEBUG(0,("api_rpc_trans_reply: malloc fail.\n"));
208 reply_nterror(req
, NT_STATUS_NO_MEMORY
);
212 if((data_len
= read_from_pipe( p
, rdata
, p
->max_trans_reply
,
213 &is_data_outstanding
)) < 0) {
215 api_no_reply(conn
,req
);
219 send_trans_reply(conn
, req
->inbuf
, NULL
, 0, rdata
, data_len
,
220 is_data_outstanding
);
225 /****************************************************************************
226 WaitNamedPipeHandleState
227 ****************************************************************************/
229 static void api_WNPHS(connection_struct
*conn
, struct smb_request
*req
, smb_np_struct
*p
,
230 char *param
, int param_len
)
234 if (!param
|| param_len
< 2) {
235 reply_nterror(req
, NT_STATUS_INVALID_PARAMETER
);
239 priority
= SVAL(param
,0);
240 DEBUG(4,("WaitNamedPipeHandleState priority %x\n", priority
));
242 if (wait_rpc_pipe_hnd_state(p
, priority
)) {
243 /* now send the reply */
244 send_trans_reply(conn
, req
->inbuf
, NULL
, 0, NULL
, 0, False
);
247 api_no_reply(conn
,req
);
251 /****************************************************************************
252 SetNamedPipeHandleState
253 ****************************************************************************/
255 static void api_SNPHS(connection_struct
*conn
, struct smb_request
*req
, smb_np_struct
*p
,
256 char *param
, int param_len
)
260 if (!param
|| param_len
< 2) {
261 reply_nterror(req
, NT_STATUS_INVALID_PARAMETER
);
266 DEBUG(4,("SetNamedPipeHandleState to code %x\n", id
));
268 if (set_rpc_pipe_hnd_state(p
, id
)) {
269 /* now send the reply */
270 send_trans_reply(conn
, req
->inbuf
, NULL
, 0, NULL
, 0, False
);
273 api_no_reply(conn
,req
);
277 /****************************************************************************
278 When no reply is generated, indicate unsupported.
279 ****************************************************************************/
281 static void api_no_reply(connection_struct
*conn
, struct smb_request
*req
)
286 SSVAL(rparam
,0,NERR_notsupported
);
287 SSVAL(rparam
,2,0); /* converter word */
289 DEBUG(3,("Unsupported API fd command\n"));
291 /* now send the reply */
292 send_trans_reply(conn
, req
->inbuf
, rparam
, 4, NULL
, 0, False
);
297 /****************************************************************************
298 Handle remote api calls delivered to a named pipe already opened.
299 ****************************************************************************/
301 static void api_fd_reply(connection_struct
*conn
, uint16 vuid
,
302 struct smb_request
*req
,
303 uint16
*setup
, char *data
, char *params
,
304 int suwcnt
, int tdscnt
, int tpscnt
,
305 int mdrcnt
, int mprcnt
)
308 smb_np_struct
*p
= NULL
;
312 DEBUG(5,("api_fd_reply\n"));
314 /* First find out the name of this file. */
316 DEBUG(0,("Unexpected named pipe transaction.\n"));
317 reply_nterror(req
, NT_STATUS_INVALID_PARAMETER
);
321 /* Get the file handle and hence the file name. */
323 * NB. The setup array has already been transformed
324 * via SVAL and so is in host byte order.
326 pnum
= ((int)setup
[1]) & 0xFFFF;
327 subcommand
= ((int)setup
[0]) & 0xFFFF;
329 if(!(p
= get_rpc_pipe(pnum
))) {
330 if (subcommand
== TRANSACT_WAITNAMEDPIPEHANDLESTATE
) {
331 /* Win9x does this call with a unicode pipe name, not a pnum. */
332 /* Just return success for now... */
333 DEBUG(3,("Got TRANSACT_WAITNAMEDPIPEHANDLESTATE on text pipe name\n"));
334 send_trans_reply(conn
, req
->inbuf
, NULL
, 0, NULL
, 0,
339 DEBUG(1,("api_fd_reply: INVALID PIPE HANDLE: %x\n", pnum
));
340 reply_nterror(req
, NT_STATUS_INVALID_HANDLE
);
344 if (vuid
!= p
->vuid
) {
345 DEBUG(1, ("Got pipe request (pnum %x) using invalid VUID %d, "
346 "expected %d\n", pnum
, vuid
, p
->vuid
));
347 reply_nterror(req
, NT_STATUS_INVALID_HANDLE
);
351 DEBUG(3,("Got API command 0x%x on pipe \"%s\" (pnum %x)\n", subcommand
, p
->name
, pnum
));
353 /* record maximum data length that can be transmitted in an SMBtrans */
354 p
->max_trans_reply
= mdrcnt
;
356 DEBUG(10,("api_fd_reply: p:%p max_trans_reply: %d\n", p
, p
->max_trans_reply
));
358 switch (subcommand
) {
359 case TRANSACT_DCERPCCMD
:
360 /* dce/rpc command */
361 reply
= write_to_pipe(p
, data
, tdscnt
);
363 api_no_reply(conn
, req
);
366 api_rpc_trans_reply(conn
, req
, p
);
368 case TRANSACT_WAITNAMEDPIPEHANDLESTATE
:
369 /* Wait Named Pipe Handle state */
370 api_WNPHS(conn
, req
, p
, params
, tpscnt
);
372 case TRANSACT_SETNAMEDPIPEHANDLESTATE
:
373 /* Set Named Pipe Handle state */
374 api_SNPHS(conn
, req
, p
, params
, tpscnt
);
377 reply_nterror(req
, NT_STATUS_INVALID_PARAMETER
);
382 /****************************************************************************
383 Handle named pipe commands.
384 ****************************************************************************/
386 static void named_pipe(connection_struct
*conn
, uint16 vuid
,
387 struct smb_request
*req
,
388 const char *name
, uint16
*setup
,
389 char *data
, char *params
,
390 int suwcnt
, int tdscnt
,int tpscnt
,
391 int msrcnt
, int mdrcnt
, int mprcnt
)
393 DEBUG(3,("named pipe command on <%s> name\n", name
));
395 if (strequal(name
,"LANMAN")) {
396 api_reply(conn
, vuid
, req
,
403 if (strequal(name
,"WKSSVC") ||
404 strequal(name
,"SRVSVC") ||
405 strequal(name
,"WINREG") ||
406 strequal(name
,"SAMR") ||
407 strequal(name
,"LSARPC")) {
409 DEBUG(4,("named pipe command from Win95 (wow!)\n"));
411 api_fd_reply(conn
, vuid
, req
,
413 suwcnt
, tdscnt
, tpscnt
,
418 if (strlen(name
) < 1) {
419 api_fd_reply(conn
, vuid
, req
,
421 params
, suwcnt
, tdscnt
,
422 tpscnt
, mdrcnt
, mprcnt
);
427 DEBUG(3,("unknown named pipe: setup 0x%X setup1=%d\n",
428 (int)setup
[0],(int)setup
[1]));
430 reply_nterror(req
, NT_STATUS_NOT_SUPPORTED
);
434 static void handle_trans(connection_struct
*conn
, struct smb_request
*req
,
435 struct trans_state
*state
)
437 char *local_machine_name
;
440 DEBUG(3,("trans <%s> data=%u params=%u setup=%u\n",
441 state
->name
,(unsigned int)state
->total_data
,(unsigned int)state
->total_param
,
442 (unsigned int)state
->setup_count
));
445 * WinCE wierdness....
448 local_machine_name
= talloc_asprintf(state
, "\\%s\\",
449 get_local_machine_name());
451 if (local_machine_name
== NULL
) {
452 reply_nterror(req
, NT_STATUS_NO_MEMORY
);
456 if (strnequal(state
->name
, local_machine_name
,
457 strlen(local_machine_name
))) {
458 name_offset
= strlen(local_machine_name
)-1;
461 if (!strnequal(&state
->name
[name_offset
], "\\PIPE",
463 reply_nterror(req
, NT_STATUS_NOT_SUPPORTED
);
467 name_offset
+= strlen("\\PIPE");
469 /* Win9x weirdness. When talking to a unicode server Win9x
470 only sends \PIPE instead of \PIPE\ */
472 if (state
->name
[name_offset
] == '\\')
475 DEBUG(5,("calling named_pipe\n"));
476 named_pipe(conn
, state
->vuid
, req
,
477 state
->name
+name_offset
,
478 state
->setup
,state
->data
,
480 state
->setup_count
,state
->total_data
,
482 state
->max_setup_return
,
483 state
->max_data_return
,
484 state
->max_param_return
);
486 if (state
->close_on_completion
) {
487 close_cnum(conn
,state
->vuid
);
494 /****************************************************************************
496 ****************************************************************************/
498 void reply_trans(struct smb_request
*req
)
500 connection_struct
*conn
= req
->conn
;
505 struct trans_state
*state
;
508 unsigned int av_size
;
510 START_PROFILE(SMBtrans
);
513 reply_nterror(req
, NT_STATUS_INVALID_PARAMETER
);
514 END_PROFILE(SMBtrans
);
518 size
= smb_len(req
->inbuf
) + 4;
519 av_size
= smb_len(req
->inbuf
);
520 dsoff
= SVAL(req
->inbuf
, smb_dsoff
);
521 dscnt
= SVAL(req
->inbuf
, smb_dscnt
);
522 psoff
= SVAL(req
->inbuf
, smb_psoff
);
523 pscnt
= SVAL(req
->inbuf
, smb_pscnt
);
525 result
= allow_new_trans(conn
->pending_trans
, req
->mid
);
526 if (!NT_STATUS_IS_OK(result
)) {
527 DEBUG(2, ("Got invalid trans request: %s\n",
529 reply_nterror(req
, result
);
530 END_PROFILE(SMBtrans
);
534 if ((state
= TALLOC_P(conn
, struct trans_state
)) == NULL
) {
535 DEBUG(0, ("talloc failed\n"));
536 reply_nterror(req
, NT_STATUS_NO_MEMORY
);
537 END_PROFILE(SMBtrans
);
541 state
->cmd
= SMBtrans
;
543 state
->mid
= req
->mid
;
544 state
->vuid
= req
->vuid
;
545 state
->setup_count
= CVAL(req
->inbuf
, smb_suwcnt
);
547 state
->total_param
= SVAL(req
->inbuf
, smb_tpscnt
);
549 state
->total_data
= SVAL(req
->inbuf
, smb_tdscnt
);
551 state
->max_param_return
= SVAL(req
->inbuf
, smb_mprcnt
);
552 state
->max_data_return
= SVAL(req
->inbuf
, smb_mdrcnt
);
553 state
->max_setup_return
= CVAL(req
->inbuf
, smb_msrcnt
);
554 state
->close_on_completion
= BITSETW(req
->inbuf
+smb_vwv5
,0);
555 state
->one_way
= BITSETW(req
->inbuf
+smb_vwv5
,1);
557 srvstr_pull_buf_talloc(state
, req
->inbuf
, req
->flags2
, &state
->name
,
558 smb_buf(req
->inbuf
), STR_TERMINATE
);
560 if ((dscnt
> state
->total_data
) || (pscnt
> state
->total_param
) ||
564 if (state
->total_data
) {
565 /* Can't use talloc here, the core routines do realloc on the
566 * params and data. Out of paranoia, 100 bytes too many. */
567 state
->data
= (char *)SMB_MALLOC(state
->total_data
+100);
568 if (state
->data
== NULL
) {
569 DEBUG(0,("reply_trans: data malloc fail for %u "
570 "bytes !\n", (unsigned int)state
->total_data
));
572 reply_nterror(req
, NT_STATUS_NO_MEMORY
);
573 END_PROFILE(SMBtrans
);
576 /* null-terminate the slack space */
577 memset(&state
->data
[state
->total_data
], 0, 100);
579 if (dscnt
> state
->total_data
||
580 dsoff
+dscnt
< dsoff
) {
584 if (dsoff
> av_size
||
586 dsoff
+dscnt
> av_size
) {
590 memcpy(state
->data
,smb_base(req
->inbuf
)+dsoff
,dscnt
);
593 if (state
->total_param
) {
594 /* Can't use talloc here, the core routines do realloc on the
595 * params and data. Out of paranoia, 100 bytes too many */
596 state
->param
= (char *)SMB_MALLOC(state
->total_param
+100);
597 if (state
->param
== NULL
) {
598 DEBUG(0,("reply_trans: param malloc fail for %u "
599 "bytes !\n", (unsigned int)state
->total_param
));
600 SAFE_FREE(state
->data
);
602 reply_nterror(req
, NT_STATUS_NO_MEMORY
);
603 END_PROFILE(SMBtrans
);
606 /* null-terminate the slack space */
607 memset(&state
->param
[state
->total_param
], 0, 100);
609 if (pscnt
> state
->total_param
||
610 psoff
+pscnt
< psoff
) {
614 if (psoff
> av_size
||
616 psoff
+pscnt
> av_size
) {
620 memcpy(state
->param
,smb_base(req
->inbuf
)+psoff
,pscnt
);
623 state
->received_data
= dscnt
;
624 state
->received_param
= pscnt
;
626 if (state
->setup_count
) {
628 if((state
->setup
= TALLOC_ARRAY(
629 state
, uint16
, state
->setup_count
)) == NULL
) {
630 DEBUG(0,("reply_trans: setup malloc fail for %u "
631 "bytes !\n", (unsigned int)
632 (state
->setup_count
* sizeof(uint16
))));
633 SAFE_FREE(state
->data
);
634 SAFE_FREE(state
->param
);
636 reply_nterror(req
, NT_STATUS_NO_MEMORY
);
637 END_PROFILE(SMBtrans
);
640 if (req
->inbuf
+smb_vwv14
+(state
->setup_count
*SIZEOFWORD
) >
643 if ((smb_vwv14
+(state
->setup_count
*SIZEOFWORD
) < smb_vwv14
) ||
644 (smb_vwv14
+(state
->setup_count
*SIZEOFWORD
) <
645 (state
->setup_count
*SIZEOFWORD
)))
648 for (i
=0;i
<state
->setup_count
;i
++)
649 state
->setup
[i
] = SVAL(req
->inbuf
,
650 smb_vwv14
+i
*SIZEOFWORD
);
653 state
->received_param
= pscnt
;
655 if ((state
->received_param
!= state
->total_param
) ||
656 (state
->received_data
!= state
->total_data
)) {
657 DLIST_ADD(conn
->pending_trans
, state
);
659 /* We need to send an interim response then receive the rest
660 of the parameter/data bytes */
661 reply_outbuf(req
, 0, 0);
662 show_msg((char *)req
->outbuf
);
663 END_PROFILE(SMBtrans
);
667 talloc_steal(talloc_tos(), state
);
669 handle_trans(conn
, req
, state
);
671 SAFE_FREE(state
->data
);
672 SAFE_FREE(state
->param
);
675 END_PROFILE(SMBtrans
);
680 DEBUG(0,("reply_trans: invalid trans parameters\n"));
681 SAFE_FREE(state
->data
);
682 SAFE_FREE(state
->param
);
684 END_PROFILE(SMBtrans
);
685 reply_nterror(req
, NT_STATUS_INVALID_PARAMETER
);
689 /****************************************************************************
690 Reply to a secondary SMBtrans.
691 ****************************************************************************/
693 void reply_transs(struct smb_request
*req
)
695 connection_struct
*conn
= req
->conn
;
696 unsigned int pcnt
,poff
,dcnt
,doff
,pdisp
,ddisp
;
697 struct trans_state
*state
;
698 unsigned int av_size
;
700 START_PROFILE(SMBtranss
);
702 show_msg((char *)req
->inbuf
);
705 reply_nterror(req
, NT_STATUS_INVALID_PARAMETER
);
706 END_PROFILE(SMBtranss
);
710 for (state
= conn
->pending_trans
; state
!= NULL
;
711 state
= state
->next
) {
712 if (state
->mid
== req
->mid
) {
717 if ((state
== NULL
) || (state
->cmd
!= SMBtrans
)) {
718 reply_nterror(req
, NT_STATUS_INVALID_PARAMETER
);
719 END_PROFILE(SMBtranss
);
723 /* Revise total_params and total_data in case they have changed
726 if (SVAL(req
->inbuf
, smb_vwv0
) < state
->total_param
)
727 state
->total_param
= SVAL(req
->inbuf
,smb_vwv0
);
728 if (SVAL(req
->inbuf
, smb_vwv1
) < state
->total_data
)
729 state
->total_data
= SVAL(req
->inbuf
,smb_vwv1
);
731 av_size
= smb_len(req
->inbuf
);
733 pcnt
= SVAL(req
->inbuf
, smb_spscnt
);
734 poff
= SVAL(req
->inbuf
, smb_spsoff
);
735 pdisp
= SVAL(req
->inbuf
, smb_spsdisp
);
737 dcnt
= SVAL(req
->inbuf
, smb_sdscnt
);
738 doff
= SVAL(req
->inbuf
, smb_sdsoff
);
739 ddisp
= SVAL(req
->inbuf
, smb_sdsdisp
);
741 state
->received_param
+= pcnt
;
742 state
->received_data
+= dcnt
;
744 if ((state
->received_data
> state
->total_data
) ||
745 (state
->received_param
> state
->total_param
))
749 if (pdisp
> state
->total_param
||
750 pcnt
> state
->total_param
||
751 pdisp
+pcnt
> state
->total_param
||
752 pdisp
+pcnt
< pdisp
) {
756 if (poff
> av_size
||
758 poff
+pcnt
> av_size
||
763 memcpy(state
->param
+pdisp
,smb_base(req
->inbuf
)+poff
,
768 if (ddisp
> state
->total_data
||
769 dcnt
> state
->total_data
||
770 ddisp
+dcnt
> state
->total_data
||
771 ddisp
+dcnt
< ddisp
) {
775 if (doff
> av_size
||
777 doff
+dcnt
> av_size
||
782 memcpy(state
->data
+ddisp
, smb_base(req
->inbuf
)+doff
,
786 if ((state
->received_param
< state
->total_param
) ||
787 (state
->received_data
< state
->total_data
)) {
788 END_PROFILE(SMBtranss
);
793 * construct_reply_common will copy smb_com from inbuf to
794 * outbuf. SMBtranss is wrong here.
796 SCVAL(req
->inbuf
,smb_com
,SMBtrans
);
798 talloc_steal(talloc_tos(), state
);
800 handle_trans(conn
, req
, state
);
802 DLIST_REMOVE(conn
->pending_trans
, state
);
803 SAFE_FREE(state
->data
);
804 SAFE_FREE(state
->param
);
807 END_PROFILE(SMBtranss
);
812 DEBUG(0,("reply_transs: invalid trans parameters\n"));
813 DLIST_REMOVE(conn
->pending_trans
, state
);
814 SAFE_FREE(state
->data
);
815 SAFE_FREE(state
->param
);
817 reply_nterror(req
, NT_STATUS_INVALID_PARAMETER
);
818 END_PROFILE(SMBtranss
);