s3-rpc_server: Store the ndr syntax id in the pipe context.
authorAndreas Schneider <asn@samba.org>
Wed, 25 May 2011 14:03:43 +0000 (16:03 +0200)
committerAndreas Schneider <asn@samba.org>
Wed, 1 Jun 2011 10:02:15 +0000 (12:02 +0200)
The client tell us in the rpc bind to which rpc service it wants to
connect. We did set the p->syntax earlier by guessing to which pipe name
it connects, but we don't know to which rpc service it wants to bind
until we read the first packet.

source3/rpc_server/srv_pipe.c

index 72c8f809593d24abbef008c9dde6f897f217bab8..a6e43b65ec07c529965c7f3cd0fd293ca1478bc2 100644 (file)
@@ -331,19 +331,19 @@ bool setup_fault_pdu(struct pipes_struct *p, NTSTATUS fault_status)
 static bool check_bind_req(struct pipes_struct *p,
                           struct ndr_syntax_id* abstract,
                           struct ndr_syntax_id* transfer,
-                          uint32 context_id)
+                          uint32_t context_id)
 {
        struct pipe_rpc_fns *context_fns;
 
        DEBUG(3,("check_bind_req for %s\n",
-                get_pipe_name_from_syntax(talloc_tos(), &p->syntax)));
+                get_pipe_name_from_syntax(talloc_tos(), abstract)));
 
        /* we have to check all now since win2k introduced a new UUID on the lsaprpc pipe */
        if (rpc_srv_pipe_exists_by_id(abstract) &&
           ndr_syntax_id_equal(transfer, &ndr_transfer_syntax)) {
-               DEBUG(3, ("check_bind_req: \\PIPE\\%s -> \\PIPE\\%s\n",
-                       rpc_srv_get_pipe_cli_name(abstract),
-                       rpc_srv_get_pipe_srv_name(abstract)));
+               DEBUG(3, ("check_bind_req: %s -> %s rpc service\n",
+                         rpc_srv_get_pipe_cli_name(abstract),
+                         rpc_srv_get_pipe_srv_name(abstract)));
        } else {
                return false;
        }
@@ -358,6 +358,7 @@ static bool check_bind_req(struct pipes_struct *p,
        context_fns->n_cmds = rpc_srv_get_pipe_num_cmds(abstract);
        context_fns->cmds = rpc_srv_get_pipe_cmds(abstract);
        context_fns->context_id = context_id;
+       context_fns->syntax = *abstract;
 
        /* add to the list of open contexts */