summaryrefslogtreecommitdiff
path: root/source3/smbd/pipes.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-14 17:38:29 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-14 17:38:29 +0000
commitb9623ab59e813131b1ed3f51616a46e719d59c21 (patch)
treea1ba04e55e67ca102b05dd22b024bab9e9d51d57 /source3/smbd/pipes.c
parent58fb3c31c03601042fdba71501068fcaea8a821c (diff)
downloadsamba-b9623ab59e813131b1ed3f51616a46e719d59c21.tar.gz
samba-b9623ab59e813131b1ed3f51616a46e719d59c21.tar.bz2
samba-b9623ab59e813131b1ed3f51616a46e719d59c21.zip
this is the bug change to using connection_struct* instead of cnum.
Connections[] is now a local array in server.c I might have broken something with this change. In particular the oplock code is suspect and some .dll files aren't being oplocked when I expected them to be. I'll look at it after I've got some sleep. (This used to be commit c7ee025ead4a85b6fa44a832047b878451845fb6)
Diffstat (limited to 'source3/smbd/pipes.c')
-rw-r--r--source3/smbd/pipes.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index 34884aa6d3..2a51e83946 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -58,10 +58,10 @@ extern struct pipe_id_info pipe_names[];
This code is basically stolen from reply_open_and_X with some
wrinkles to handle pipes.
****************************************************************************/
-int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize)
+int reply_open_pipe_and_X(connection_struct *conn,
+ char *inbuf,char *outbuf,int length,int bufsize)
{
pstring fname;
- uint16 cnum = SVAL(inbuf, smb_tid);
uint16 vuid = SVAL(inbuf, smb_uid);
int pnum = -1;
int smb_ofun = SVAL(inbuf,smb_vwv8);
@@ -95,7 +95,7 @@ int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize)
DEBUG(3,("Known pipe %s opening.\n",fname));
smb_ofun |= 0x10; /* Add Create it not exists flag */
- pnum = open_rpc_pipe_hnd(fname, cnum, vuid);
+ pnum = open_rpc_pipe_hnd(fname, conn, vuid);
if (pnum < 0) return(ERROR(ERRSRV,ERRnofids));
/* Prepare the reply */
@@ -134,13 +134,10 @@ int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize)
uint32 smb_offs = IVAL(inbuf,smb_vwv3);
int smb_maxcnt = SVAL(inbuf,smb_vwv5);
int smb_mincnt = SVAL(inbuf,smb_vwv6);
- int cnum;
int nread = -1;
char *data;
BOOL ok = False;
- cnum = SVAL(inbuf,smb_tid);
-
/*
CHECK_FNUM(fnum,cnum);
CHECK_READ(fnum);
@@ -161,8 +158,8 @@ int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize)
SSVAL(outbuf,smb_vwv6,smb_offset(data,outbuf));
SSVAL(smb_buf(outbuf),-2,nread);
- DEBUG( 3, ( "readX pnum=%04x cnum=%d min=%d max=%d nread=%d\n",
- pnum, cnum, smb_mincnt, smb_maxcnt, nread ) );
+ DEBUG(3,("readX pnum=%04x min=%d max=%d nread=%d\n",
+ pnum, smb_mincnt, smb_maxcnt, nread));
set_chain_pnum(pnum);
@@ -171,15 +168,14 @@ int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize)
/****************************************************************************
reply to a close
****************************************************************************/
-int reply_pipe_close(char *inbuf,char *outbuf)
+int reply_pipe_close(connection_struct *conn, char *inbuf,char *outbuf)
{
int pnum = get_rpc_pipe_num(inbuf,smb_vwv0);
- int cnum = SVAL(inbuf,smb_tid);
int outsize = set_message(outbuf,0,0,True);
- DEBUG(5,("reply_pipe_close: pnum:%x cnum:%x\n", pnum, cnum));
+ DEBUG(5,("reply_pipe_close: pnum:%x\n", pnum));
- if (!close_rpc_pipe_hnd(pnum, cnum)) return(ERROR(ERRDOS,ERRbadfid));
+ if (!close_rpc_pipe_hnd(pnum, conn)) return(ERROR(ERRDOS,ERRbadfid));
return(outsize);
}