summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1997-10-30 21:51:15 +0000
committerLuke Leighton <lkcl@samba.org>1997-10-30 21:51:15 +0000
commit55e2dc7c6f4378adfdcbd166b2680096a3e4a5a4 (patch)
tree91087a9b41b3935d5b537c7aaab5a4f2fbd505c1
parent3e0fb1883cb8100d2cb696eb61fbc2798cb9da49 (diff)
downloadsamba-55e2dc7c6f4378adfdcbd166b2680096a3e4a5a4.tar.gz
samba-55e2dc7c6f4378adfdcbd166b2680096a3e4a5a4.tar.bz2
samba-55e2dc7c6f4378adfdcbd166b2680096a3e4a5a4.zip
storing pipe name state (from set named pipe handle state call) in the
pipes array. (This used to be commit 5335d5cdc4659f4676958f0399e2de29a117c133)
-rw-r--r--source3/include/proto.h5
-rw-r--r--source3/smbd/ipc.c24
-rw-r--r--source3/smbd/pipes.c15
3 files changed, 21 insertions, 23 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index f9d1044505..d417d82f93 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -659,10 +659,7 @@ void pcap_printer_fn(void (*fn)());
int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize);
int reply_pipe_close(char *inbuf,char *outbuf);
-BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data,
- int mdrcnt,int mprcnt,
- char **rdata,char **rparam,
- int *rdata_len,int *rparam_len);
+BOOL api_LsarpcSNPHS(int pnum, int cnum, char *param);
BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data,
int mdrcnt,int mprcnt,
char **rdata,char **rparam,
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index a42baea80a..1943129ba6 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -2871,15 +2871,11 @@ struct
} api_fd_commands [] =
{
#ifdef NTDOMAIN
- { "SetNmdPpHndState", "lsarpc", "lsass", 1, api_LsarpcSNPHS },
- { "SetNmdPpHndState", "srvsvc", "lsass", 1, api_LsarpcSNPHS },
- { "SetNmdPpHndState", "NETLOGON", "NETLOGON", 1, api_LsarpcSNPHS },
{ "TransactNmPipe", "lsarpc", "lsass", 0x26, api_ntLsarpcTNP },
{ "TransactNmPipe", "srvsvc", "lsass", 0x26, api_srvsvcTNP },
{ "TransactNmPipe", "NETLOGON", "NETLOGON", 0x26, api_netlogrpcTNP },
{ NULL, NULL, NULL, -1, (BOOL (*)())api_Unsupported }
#else
- { "SetNmdPpHndState", "lsarpc", 1, api_LsarpcSNPHS },
{ "TransactNmPipe" , "lsarpc", 0x26, api_LsarpcTNP },
{ NULL, NULL, -1, (BOOL (*)())api_Unsupported }
#endif
@@ -2899,6 +2895,7 @@ static int api_fd_reply(int cnum,uint16 vuid,char *outbuf,
BOOL reply = False;
BOOL bind_req = False;
+ BOOL set_nphs = False;
int i;
int fd;
@@ -2943,6 +2940,7 @@ static int api_fd_reply(int cnum,uint16 vuid,char *outbuf,
rparam = (char *)malloc(1024); if (rparam) bzero(rparam,1024);
#ifdef NTDOMAIN
+ /* RPC Pipe command 0x26. */
if (data != NULL && api_fd_commands[i].subcommand == 0x26)
{
RPC_HDR hdr;
@@ -2988,7 +2986,14 @@ static int api_fd_reply(int cnum,uint16 vuid,char *outbuf,
}
#endif
- if (!bind_req)
+ /* Set Named Pipe Handle state */
+ if (subcommand == 0x1)
+ {
+ set_nphs = True;
+ reply = api_LsarpcSNPHS(fd, cnum, params);
+ }
+
+ if (!bind_req && !set_nphs)
{
DEBUG(10,("calling api_fd_command\n"));
@@ -3003,19 +3008,18 @@ static int api_fd_reply(int cnum,uint16 vuid,char *outbuf,
&rdata,&rparam,&rdata_len,&rparam_len);
}
-
/* if we get False back then it's actually unsupported */
if (!reply)
+ {
api_Unsupported(cnum,vuid,params,data,mdrcnt,mprcnt,
&rdata,&rparam,&rdata_len,&rparam_len);
+ }
/* now send the reply */
send_trans_reply(outbuf,rdata,rparam,NULL,rdata_len,rparam_len,0);
- if (rdata)
- free(rdata);
- if (rparam)
- free(rparam);
+ if (rdata ) free(rdata );
+ if (rparam) free(rparam);
return(-1);
}
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index ff93041fbc..4a2e185cb4 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -148,21 +148,18 @@ int reply_pipe_close(char *inbuf,char *outbuf)
/****************************************************************************
api_LsarpcSNPHS
- SetNamedPipeHandleState on \PIPE\lsarpc. We can't really do much here,
- so just blithely return True. This is really only for NT domain stuff,
- we we're only handling that - don't assume Samba now does complete
- named pipe handling.
+ SetNamedPipeHandleState on \PIPE\lsarpc.
****************************************************************************/
-BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data,
- int mdrcnt,int mprcnt,
- char **rdata,char **rparam,
- int *rdata_len,int *rparam_len)
+BOOL api_LsarpcSNPHS(int pnum, int cnum, char *param)
{
uint16 id;
+ if (!param) return False;
+
id = param[0] + (param[1] << 8);
DEBUG(4,("lsarpc SetNamedPipeHandleState to code %x\n",id));
- return(True);
+
+ return set_rpc_pipe_hnd_state(pnum, cnum, id);
}