1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

r24231: Push allocating InBuffer/OutBuffer into reply_transs

(This used to be commit 74ae19cca6dd15b65deffbf464cfd0e485da8611)
This commit is contained in:
Volker Lendecke 2007-08-05 08:47:09 +00:00 committed by Gerald (Jerry) Carter
parent f1822fe737
commit 1d3c1de502
2 changed files with 21 additions and 10 deletions

View File

@ -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;
}

View File

@ -726,7 +726,7 @@ static const struct smb_message_struct {
/* 0x23 */ { "SMBgetattrE",reply_getattrE,NULL,AS_USER },
/* 0x24 */ { "SMBlockingX",reply_lockingX,NULL,AS_USER },
/* 0x25 */ { "SMBtrans",NULL,reply_trans,AS_USER | CAN_IPC },
/* 0x26 */ { "SMBtranss",reply_transs,NULL,AS_USER | CAN_IPC},
/* 0x26 */ { "SMBtranss",NULL,reply_transs,AS_USER | CAN_IPC},
/* 0x27 */ { "SMBioctl",reply_ioctl,NULL,0},
/* 0x28 */ { "SMBioctls",NULL, NULL,AS_USER},
/* 0x29 */ { "SMBcopy",reply_copy,NULL,AS_USER | NEED_WRITE },