summaryrefslogtreecommitdiff
path: root/source3/smbd/pipes.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-08 18:40:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:24 -0500
commita6810cb9a303d31dfedfb4bdc52f4d4df7e4eb90 (patch)
treec4c6cac773ae6df64a1048159bbf434ed3cfa723 /source3/smbd/pipes.c
parent3e8fc031c8c28880657423de632172b2717f07a7 (diff)
downloadsamba-a6810cb9a303d31dfedfb4bdc52f4d4df7e4eb90.tar.gz
samba-a6810cb9a303d31dfedfb4bdc52f4d4df7e4eb90.tar.bz2
samba-a6810cb9a303d31dfedfb4bdc52f4d4df7e4eb90.zip
r24278: Push down reply_prep_legacy in reply_write_and_X
Remove the need for reply_prep_legacy for reply_pipe_write_and_X (This used to be commit de143d5fa61aa487613dda729a43dc3d59a72899)
Diffstat (limited to 'source3/smbd/pipes.c')
-rw-r--r--source3/smbd/pipes.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index 24e0f47001..cf12b4be4d 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -183,26 +183,29 @@ int reply_pipe_write(char *inbuf,char *outbuf,int length,int dum_bufsize)
wrinkles to handle pipes.
****************************************************************************/
-int reply_pipe_write_and_X(char *inbuf,char *outbuf,int length,int bufsize)
+void reply_pipe_write_and_X(struct smb_request *req)
{
- smb_np_struct *p = get_rpc_pipe_p(SVAL(inbuf,smb_vwv2));
- uint16 vuid = SVAL(inbuf,smb_uid);
- size_t numtowrite = SVAL(inbuf,smb_vwv10);
+ smb_np_struct *p = get_rpc_pipe_p(SVAL(req->inbuf,smb_vwv2));
+ size_t numtowrite = SVAL(req->inbuf,smb_vwv10);
int nwritten = -1;
- int smb_doff = SVAL(inbuf, smb_vwv11);
- BOOL pipe_start_message_raw = ((SVAL(inbuf, smb_vwv7) & (PIPE_START_MESSAGE|PIPE_RAW_MODE)) ==
- (PIPE_START_MESSAGE|PIPE_RAW_MODE));
+ int smb_doff = SVAL(req->inbuf, smb_vwv11);
+ BOOL pipe_start_message_raw =
+ ((SVAL(req->inbuf, smb_vwv7)
+ & (PIPE_START_MESSAGE|PIPE_RAW_MODE))
+ == (PIPE_START_MESSAGE|PIPE_RAW_MODE));
char *data;
if (!p) {
- return(ERROR_DOS(ERRDOS,ERRbadfid));
+ reply_doserror(req, ERRDOS, ERRbadfid);
+ return;
}
- if (p->vuid != vuid) {
- return ERROR_NT(NT_STATUS_INVALID_HANDLE);
+ if (p->vuid != req->vuid) {
+ reply_nterror(req, NT_STATUS_INVALID_HANDLE);
+ return;
}
- data = smb_base(inbuf) + smb_doff;
+ data = smb_base(req->inbuf) + smb_doff;
if (numtowrite == 0) {
nwritten = 0;
@@ -214,9 +217,12 @@ int reply_pipe_write_and_X(char *inbuf,char *outbuf,int length,int bufsize)
* them (we don't trust the client). JRA.
*/
if(numtowrite < 2) {
- DEBUG(0,("reply_pipe_write_and_X: start of message set and not enough data sent.(%u)\n",
- (unsigned int)numtowrite ));
- return (UNIXERROR(ERRDOS,ERRnoaccess));
+ DEBUG(0,("reply_pipe_write_and_X: start of "
+ "message set and not enough data "
+ "sent.(%u)\n",
+ (unsigned int)numtowrite ));
+ reply_unixerror(req, ERRDOS, ERRnoaccess);
+ return;
}
data += 2;
@@ -226,17 +232,18 @@ int reply_pipe_write_and_X(char *inbuf,char *outbuf,int length,int bufsize)
}
if ((nwritten == 0 && numtowrite != 0) || (nwritten < 0)) {
- return (UNIXERROR(ERRDOS,ERRnoaccess));
+ reply_unixerror(req, ERRDOS,ERRnoaccess);
+ return;
}
-
- set_message(inbuf,outbuf,6,0,True);
+
+ reply_outbuf(req, 6, 0);
nwritten = (pipe_start_message_raw ? nwritten + 2 : nwritten);
- SSVAL(outbuf,smb_vwv2,nwritten);
+ SSVAL(req->outbuf,smb_vwv2,nwritten);
DEBUG(3,("writeX-IPC pnum=%04x nwritten=%d\n", p->pnum, nwritten));
- return chain_reply(inbuf,&outbuf,length,bufsize);
+ chain_reply_new(req);
}
/****************************************************************************