summaryrefslogtreecommitdiff
path: root/source3/smbd/pipes.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-11 10:53:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:29 -0500
commit8e146e4b7b284a4e89eea11272407c57090af395 (patch)
tree2285a4a3932fc2aed289df9b6fbfad026ab0acc8 /source3/smbd/pipes.c
parent8d6dcd94eba51a39f510fc2351fb9e2b7fcbc3ce (diff)
downloadsamba-8e146e4b7b284a4e89eea11272407c57090af395.tar.gz
samba-8e146e4b7b284a4e89eea11272407c57090af395.tar.bz2
samba-8e146e4b7b284a4e89eea11272407c57090af395.zip
r24324: No reply_prep_legacy() in reply_pipe_read_and_X
(This used to be commit 304843315c5457ff0288d66d31f1ddb1ef2796f4)
Diffstat (limited to 'source3/smbd/pipes.c')
-rw-r--r--source3/smbd/pipes.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index cf12b4be4d..7a221fa37e 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -252,11 +252,11 @@ void reply_pipe_write_and_X(struct smb_request *req)
wrinkles to handle pipes.
****************************************************************************/
-int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize)
+void reply_pipe_read_and_X(struct smb_request *req)
{
- smb_np_struct *p = get_rpc_pipe_p(SVAL(inbuf,smb_vwv2));
- int smb_maxcnt = SVAL(inbuf,smb_vwv5);
- int smb_mincnt = SVAL(inbuf,smb_vwv6);
+ smb_np_struct *p = get_rpc_pipe_p(SVAL(req->inbuf,smb_vwv2));
+ int smb_maxcnt = SVAL(req->inbuf,smb_vwv5);
+ int smb_mincnt = SVAL(req->inbuf,smb_vwv6);
int nread = -1;
char *data;
BOOL unused;
@@ -265,32 +265,35 @@ int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize)
is deliberate, instead we always return the next lump of
data on the pipe */
#if 0
- uint32 smb_offs = IVAL(inbuf,smb_vwv3);
+ uint32 smb_offs = IVAL(req->inbuf,smb_vwv3);
#endif
if (!p) {
- return(ERROR_DOS(ERRDOS,ERRbadfid));
+ reply_doserror(req, ERRDOS, ERRbadfid);
+ return;
}
- set_message(inbuf,outbuf,12,0,True);
- data = smb_buf(outbuf);
+ reply_outbuf(req, 12, smb_maxcnt);
+
+ data = smb_buf(req->outbuf);
nread = read_from_pipe(p, data, smb_maxcnt, &unused);
if (nread < 0) {
- return(UNIXERROR(ERRDOS,ERRnoaccess));
+ reply_doserror(req, ERRDOS, ERRnoaccess);
+ return;
}
+
+ set_message(NULL, (char *)req->outbuf, 12, nread, False);
- SSVAL(outbuf,smb_vwv5,nread);
- SSVAL(outbuf,smb_vwv6,smb_offset(data,outbuf));
- SSVAL(smb_buf(outbuf),-2,nread);
+ SSVAL(req->outbuf,smb_vwv5,nread);
+ SSVAL(req->outbuf,smb_vwv6,smb_offset(data,req->outbuf));
+ SSVAL(smb_buf(req->outbuf),-2,nread);
DEBUG(3,("readX-IPC pnum=%04x min=%d max=%d nread=%d\n",
p->pnum, smb_mincnt, smb_maxcnt, nread));
- /* Ensure we set up the message length to include the data length read. */
- set_message_bcc(inbuf,outbuf,nread);
- return chain_reply(inbuf,&outbuf,length,bufsize);
+ return chain_reply_new(req);
}
/****************************************************************************