summaryrefslogtreecommitdiff
path: root/source3/smbd/pipes.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-15 22:11:10 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-15 22:11:10 +0000
commitb231d2fafaff8dc67ef2dbaec778f716524d4f6a (patch)
tree054f060f9d6cd60535ebee5501177d8b839b7577 /source3/smbd/pipes.c
parent4c479f0574019afb2fc8a3dbfc802c75fde89244 (diff)
downloadsamba-b231d2fafaff8dc67ef2dbaec778f716524d4f6a.tar.gz
samba-b231d2fafaff8dc67ef2dbaec778f716524d4f6a.tar.bz2
samba-b231d2fafaff8dc67ef2dbaec778f716524d4f6a.zip
- added DCE/RPC "fault" PDU support.
- disabled (AGAIN) the GETDC "if (MAILSLOT\NTLOGON)" code that will get NT5rc2 to work but WILL break win95 (AGAIN). this needs _not_ to be re-enabled but to be replaced with a better mechanism. - added SMBwrite support (note: SMBwriteX already existed) as NT5rc2 is sending DCE/RPC over SMBwrite not SMBwriteX. (This used to be commit 25c70e3c984c4fed19763ed405741e83fe14f87e)
Diffstat (limited to 'source3/smbd/pipes.c')
-rw-r--r--source3/smbd/pipes.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index 374aa70d0f..e20d049834 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -104,6 +104,47 @@ int reply_open_pipe_and_X(connection_struct *conn,
return chain_reply(inbuf,outbuf,length,bufsize);
}
+/****************************************************************************
+ reply to a write
+
+ This code is basically stolen from reply_write with some
+ wrinkles to handle pipes.
+****************************************************************************/
+int reply_pipe_write(char *inbuf,char *outbuf,int length,int bufsize)
+{
+ pipes_struct *p = get_rpc_pipe_p(inbuf,smb_vwv0);
+ size_t numtowrite = SVAL(inbuf,smb_vwv1);
+ int nwritten = -1;
+ char *data;
+ size_t outsize;
+
+ if (!p) return(ERROR(ERRDOS,ERRbadfid));
+
+ data = smb_buf(inbuf) + 3;
+
+ if (numtowrite == 0)
+ {
+ nwritten = 0;
+ }
+ else
+ {
+ nwritten = write_pipe(p, data, numtowrite);
+ }
+
+ if ((nwritten == 0 && numtowrite != 0) || (nwritten < 0))
+ {
+ return (UNIXERROR(ERRDOS,ERRnoaccess));
+ }
+
+ outsize = set_message(outbuf,1,0,True);
+
+ SSVAL(outbuf,smb_vwv0,nwritten);
+
+ DEBUG(3,("write-IPC pnum=%04x nwritten=%d\n",
+ p->pnum, nwritten));
+
+ return outsize;
+}
/****************************************************************************
reply to a write and X