summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2000-02-07 16:25:15 +0000
committerJean-François Micouleau <jfm@samba.org>2000-02-07 16:25:15 +0000
commit195e3d44daccc3b6457486018ba0322ac9d44566 (patch)
treeaa6de6d3e640dc029b41deabc1a87e02a0ffebff /source3/rpc_server
parent59ac32c2556e970ea1fe171e7b76cfee2142fbf0 (diff)
downloadsamba-195e3d44daccc3b6457486018ba0322ac9d44566.tar.gz
samba-195e3d44daccc3b6457486018ba0322ac9d44566.tar.bz2
samba-195e3d44daccc3b6457486018ba0322ac9d44566.zip
spoolss definitions.
also added some prs_struct functions, 'cause I'm handling buffers as prs_struct. J.F. (This used to be commit 81e375bbbe0fb022a44a2aaaa3729a9518b7a854)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_pipe_srv.c47
1 files changed, 43 insertions, 4 deletions
diff --git a/source3/rpc_server/srv_pipe_srv.c b/source3/rpc_server/srv_pipe_srv.c
index 236558ba70..2cebc8148b 100644
--- a/source3/rpc_server/srv_pipe_srv.c
+++ b/source3/rpc_server/srv_pipe_srv.c
@@ -465,6 +465,7 @@ static struct api_cmd api_fd_commands[] =
#if DISABLED_IN_2_0
{ "winreg", "winreg", api_reg_rpc },
#endif
+ { "spoolss", "spoolss", api_spoolss_rpc },
{ NULL, NULL, NULL }
};
@@ -585,7 +586,7 @@ static BOOL setup_bind_nak(pipes_struct *p, prs_struct *pd)
Respond to a pipe bind request.
*******************************************************************/
-static BOOL api_pipe_bind_req(pipes_struct *p, prs_struct *pd)
+static BOOL api_pipe_bind_and_alt_req(pipes_struct *p, prs_struct *pd, enum RPC_PKT_TYPE pkt_type)
{
RPC_HDR_BA hdr_ba;
RPC_HDR_RB hdr_rb;
@@ -684,9 +685,21 @@ static BOOL api_pipe_bind_req(pipes_struct *p, prs_struct *pd)
p->ntlmssp_auth_requested = True;
}
- /* name has to be \PIPE\xxxxx */
- fstrcpy(ack_pipe_name, "\\PIPE\\");
- fstrcat(ack_pipe_name, p->pipe_srv_name);
+ switch (pkt_type) {
+ case RPC_BINDACK:
+ /* name has to be \PIPE\xxxxx */
+ fstrcpy(ack_pipe_name, "\\PIPE\\");
+ fstrcat(ack_pipe_name, p->pipe_srv_name);
+ case RPC_ALTCONTRESP:
+ /* secondary address CAN be NULL
+ * as the specs says it's ignored.
+ * It MUST NULL to have the spoolss working.
+ */
+ fstrcpy(ack_pipe_name, "");
+ break;
+ default:
+ return False;
+ }
DEBUG(5,("api_pipe_bind_req: make response. %d\n", __LINE__));
@@ -831,6 +844,29 @@ static BOOL api_pipe_bind_req(pipes_struct *p, prs_struct *pd)
return False;
}
+/*******************************************************************
+ Respond to a pipe bind request.
+*******************************************************************/
+
+static BOOL api_pipe_bind_req(pipes_struct *p, prs_struct *pd)
+{
+ return api_pipe_bind_and_alt_req(p, pd, RPC_BINDACK);
+}
+
+/*******************************************************************
+ Respond to a pipe alter request.
+
+ The RPC Alter-Context call is used only by the spoolss pipe
+ simply because there is a bug (?) in the MS unmarshalling code
+ or in the marshalling code. If it's in the later, then Samba
+ have the same bug.
+*******************************************************************/
+
+static BOOL api_pipe_altercontext_req(pipes_struct *p, prs_struct *pd)
+{
+ return api_pipe_bind_and_alt_req(p, pd, RPC_ALTCONTRESP);
+}
+
/****************************************************************************
Deal with sign & seal processing on an RPC request.
****************************************************************************/
@@ -1011,6 +1047,9 @@ BOOL rpc_command(pipes_struct *p, char *input_data, int data_len)
case RPC_BIND:
reply = api_pipe_bind_req(p, &rpc_in);
break;
+ case RPC_ALTCONT:
+ reply = api_pipe_altercontext_req(p, &rpc_in);
+ break;
case RPC_REQUEST:
if (p->ntlmssp_auth_requested && !p->ntlmssp_auth_validated) {
/* authentication _was_ requested