diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-08-05 08:47:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:29:18 -0500 |
commit | 74ae19cca6dd15b65deffbf464cfd0e485da8611 (patch) | |
tree | 690e88caa8bb8c972afc9944b4678a8137a1c430 /source/smbd/ipc.c | |
parent | 50a2bfd9e04d51aa5e3ae9d6620a98eeb158b6ea (diff) | |
download | samba-74ae19cca6dd15b65deffbf464cfd0e485da8611.tar.gz samba-74ae19cca6dd15b65deffbf464cfd0e485da8611.tar.xz samba-74ae19cca6dd15b65deffbf464cfd0e485da8611.zip |
r24231: Push allocating InBuffer/OutBuffer into reply_transs
Diffstat (limited to 'source/smbd/ipc.c')
-rw-r--r-- | source/smbd/ipc.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/source/smbd/ipc.c b/source/smbd/ipc.c index 8b80d8bcc40..17c27b9957b 100644 --- a/source/smbd/ipc.c +++ b/source/smbd/ipc.c @@ -703,21 +703,29 @@ void reply_trans(connection_struct *conn, struct smb_request *req) Reply to a secondary SMBtrans. ****************************************************************************/ -int reply_transs(connection_struct *conn, char *inbuf,char *outbuf, - int size, int bufsize) +void reply_transs(connection_struct *conn, struct smb_request *req) { int outsize = 0; unsigned int pcnt,poff,dcnt,doff,pdisp,ddisp; struct trans_state *state; NTSTATUS result; + char *inbuf, *outbuf; + int size, bufsize; START_PROFILE(SMBtranss); + if (!reply_prep_legacy(req, &inbuf, &outbuf, &size, &bufsize)) { + reply_nterror(req, NT_STATUS_NO_MEMORY); + END_PROFILE(SMBtranss); + return; + } + show_msg(inbuf); - if (SVAL(inbuf, smb_wct) < 10) { + if (req->wct < 10) { + reply_nterror(req, NT_STATUS_INVALID_PARAMETER); END_PROFILE(SMBtranss); - return ERROR_NT(NT_STATUS_INVALID_PARAMETER); + return; } for (state = conn->pending_trans; state != NULL; @@ -728,8 +736,9 @@ int reply_transs(connection_struct *conn, char *inbuf,char *outbuf, } if ((state == NULL) || (state->cmd != SMBtrans)) { + reply_nterror(req, NT_STATUS_INVALID_PARAMETER); END_PROFILE(SMBtranss); - return ERROR_NT(NT_STATUS_INVALID_PARAMETER); + return; } /* Revise total_params and total_data in case they have changed @@ -792,7 +801,7 @@ int reply_transs(connection_struct *conn, char *inbuf,char *outbuf, if ((state->received_param < state->total_param) || (state->received_data < state->total_data)) { END_PROFILE(SMBtranss); - return -1; + return; } /* construct_reply_common has done us the favor to pre-fill the @@ -808,12 +817,13 @@ int reply_transs(connection_struct *conn, char *inbuf,char *outbuf, TALLOC_FREE(state); if ((outsize == 0) || !NT_STATUS_IS_OK(result)) { + reply_doserror(req, ERRSRV, ERRnosupport); END_PROFILE(SMBtranss); - return(ERROR_DOS(ERRSRV,ERRnosupport)); + return; } END_PROFILE(SMBtranss); - return(outsize); + return; bad_param: @@ -822,6 +832,7 @@ int reply_transs(connection_struct *conn, char *inbuf,char *outbuf, SAFE_FREE(state->data); SAFE_FREE(state->param); TALLOC_FREE(state); + reply_nterror(req, NT_STATUS_INVALID_PARAMETER); END_PROFILE(SMBtranss); - return ERROR_NT(NT_STATUS_INVALID_PARAMETER); + return; } |