summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/ipc.c24
-rw-r--r--source3/smbd/pipes.c15
2 files changed, 20 insertions, 19 deletions
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);
}