s3-rpc: use ndr_interface_name() instead of get_pipe_name_from_syntax() in DEBUG.
authorGünther Deschner <gd@samba.org>
Wed, 18 Sep 2013 08:58:16 +0000 (10:58 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 20 Sep 2013 11:07:16 +0000 (13:07 +0200)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpc_server/rpc_handles.c
source3/rpc_server/srv_pipe.c
source3/rpc_server/srv_pipe_hnd.c
source3/wscript_build

index 70c3919e61d5fe14956f5dfe0c01d71cd42c59e6..409299abce382db0004e81fd8c4fee69bbcbcb3d 100644 (file)
@@ -27,6 +27,7 @@
 #include "rpc_server/rpc_pipes.h"
 #include "../libcli/security/security.h"
 #include "lib/tsocket/tsocket.h"
+#include "librpc/ndr/ndr_table.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
@@ -218,7 +219,8 @@ bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *synta
 
                DEBUG(10,("init_pipe_handle_list: created handle list for "
                          "pipe %s\n",
-                         get_pipe_name_from_syntax(talloc_tos(), syntax)));
+                         ndr_interface_name(&syntax->uuid,
+                                            syntax->if_version)));
        }
 
        /*
@@ -235,7 +237,7 @@ bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *synta
 
        DEBUG(10,("init_pipe_handle_list: pipe_handles ref count = %lu for "
                  "pipe %s\n", (unsigned long)p->pipe_handles->pipe_ref_count,
-                 get_pipe_name_from_syntax(talloc_tos(), syntax)));
+                 ndr_interface_name(&syntax->uuid, syntax->if_version)));
 
        return True;
 }
@@ -412,8 +414,8 @@ void close_policy_by_pipe(struct pipes_struct *p)
                TALLOC_FREE(p->pipe_handles);
 
                DEBUG(10,("Deleted handle list for RPC connection %s\n",
-                         get_pipe_name_from_syntax(talloc_tos(),
-                                                   &p->contexts->syntax)));
+                         ndr_interface_name(&p->contexts->syntax.uuid,
+                                            p->contexts->syntax.if_version)));
        }
 }
 
@@ -456,8 +458,9 @@ void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd,
        if (p->pipe_handles->count > MAX_OPEN_POLS) {
                DEBUG(0, ("ERROR: Too many handles (%d) for RPC connection %s\n",
                          (int) p->pipe_handles->count,
-                         get_pipe_name_from_syntax(talloc_tos(),
-                                                   &p->contexts->syntax)));
+                         ndr_interface_name(&p->contexts->syntax.uuid,
+                                            p->contexts->syntax.if_version)));
+
                *pstatus = NT_STATUS_INSUFFICIENT_RESOURCES;
                return NULL;
        }
index c46c98acc1bce101869cb45a31baac7777bc11f2..08074057432cfbf2fb898b9958f15291b0328b0c 100644 (file)
@@ -41,6 +41,7 @@
 #include "rpc_server/srv_pipe.h"
 #include "rpc_server/rpc_contexts.h"
 #include "lib/param/param.h"
+#include "librpc/ndr/ndr_table.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
@@ -336,7 +337,8 @@ static bool check_bind_req(struct pipes_struct *p,
        bool ok;
 
        DEBUG(3,("check_bind_req for %s\n",
-                get_pipe_name_from_syntax(talloc_tos(), abstract)));
+                ndr_interface_name(&abstract->uuid,
+                                   abstract->if_version)));
 
        /* we have to check all now since win2k introduced a new UUID on the lsaprpc pipe */
        if (rpc_srv_pipe_exists_by_id(abstract) &&
@@ -580,7 +582,8 @@ static bool api_pipe_bind_req(struct pipes_struct *p,
                if (NT_STATUS_IS_ERR(status)) {
                        DEBUG(3,("api_pipe_bind_req: Unknown rpc service name "
                                  "%s in bind request.\n",
-                                get_pipe_name_from_syntax(talloc_tos(), &id)));
+                                ndr_interface_name(&id.uuid,
+                                                   id.if_version)));
 
                        return setup_bind_nak(p, pkt);
                }
@@ -595,8 +598,10 @@ static bool api_pipe_bind_req(struct pipes_struct *p,
                } else {
                        DEBUG(0, ("module %s doesn't provide functions for "
                                  "pipe %s!\n",
-                                 get_pipe_name_from_syntax(talloc_tos(), &id),
-                                 get_pipe_name_from_syntax(talloc_tos(), &id)));
+                                 ndr_interface_name(&id.uuid,
+                                                    id.if_version),
+                                 ndr_interface_name(&id.uuid,
+                                                    id.if_version)));
                        return setup_bind_nak(p, pkt);
                }
        }
@@ -1206,7 +1211,8 @@ static bool api_pipe_request(struct pipes_struct *p,
                TALLOC_CTX *frame = talloc_stackframe();
 
                DEBUG(5, ("Requested %s rpc service\n",
-                         get_pipe_name_from_syntax(talloc_tos(), &pipe_fns->syntax)));
+                         ndr_interface_name(&pipe_fns->syntax.uuid,
+                                            pipe_fns->syntax.if_version)));
 
                ret = api_rpcTNP(p, pkt, pipe_fns->cmds, pipe_fns->n_cmds,
                                 &pipe_fns->syntax);
@@ -1237,7 +1243,7 @@ static bool api_rpcTNP(struct pipes_struct *p, struct ncacn_packet *pkt,
 
        /* interpret the command */
        DEBUG(4,("api_rpcTNP: %s op 0x%x - ",
-                get_pipe_name_from_syntax(talloc_tos(), syntax),
+                ndr_interface_name(&syntax->uuid, syntax->if_version),
                 pkt->u.request.opnum));
 
        if (DEBUGLEVEL >= 50) {
@@ -1276,7 +1282,7 @@ static bool api_rpcTNP(struct pipes_struct *p, struct ncacn_packet *pkt,
        /* do the actual command */
        if(!api_rpc_cmds[fn_num].fn(p)) {
                DEBUG(0,("api_rpcTNP: %s: %s failed.\n",
-                        get_pipe_name_from_syntax(talloc_tos(), syntax),
+                        ndr_interface_name(&syntax->uuid, syntax->if_version),
                         api_rpc_cmds[fn_num].name));
                data_blob_free(&p->out_data.rdata);
                return False;
@@ -1299,7 +1305,7 @@ static bool api_rpcTNP(struct pipes_struct *p, struct ncacn_packet *pkt,
        }
 
        DEBUG(5,("api_rpcTNP: called %s successfully\n",
-                get_pipe_name_from_syntax(talloc_tos(), syntax)));
+                ndr_interface_name(&syntax->uuid, syntax->if_version)));
 
        /* Check for buffer underflow in rpc parsing */
        if ((DEBUGLEVEL >= 10) &&
index 3f8ff44767b9232e0d762c0a1b0403c1311517d2..fcbfa77c7b60fa96f64a2ef5302b501e8a246cc2 100644 (file)
@@ -30,6 +30,7 @@
 #include "rpc_server/rpc_config.h"
 #include "../lib/tsocket/tsocket.h"
 #include "../lib/util/tevent_ntstatus.h"
+#include "librpc/ndr/ndr_table.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
@@ -281,7 +282,8 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data,
        }
 
        DEBUG(6,(" name: %s len: %u\n",
-                get_pipe_name_from_syntax(talloc_tos(), &p->contexts->syntax),
+                ndr_interface_name(&p->contexts->syntax.uuid,
+                                   p->contexts->syntax.if_version),
                 (unsigned int)n));
 
        /*
@@ -299,7 +301,8 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data,
                 DEBUG(5,("read_from_pipe: too large read (%u) requested on "
                         "pipe %s. We can only service %d sized reads.\n",
                         (unsigned int)n,
-                        get_pipe_name_from_syntax(talloc_tos(), &p->contexts->syntax),
+                        ndr_interface_name(&p->contexts->syntax.uuid,
+                                           p->contexts->syntax.if_version),
                         RPC_MAX_PDU_FRAG_LEN ));
                n = RPC_MAX_PDU_FRAG_LEN;
        }
@@ -320,7 +323,8 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data,
 
                DEBUG(10,("read_from_pipe: %s: current_pdu_len = %u, "
                          "current_pdu_sent = %u returning %d bytes.\n",
-                         get_pipe_name_from_syntax(talloc_tos(), &p->contexts->syntax),
+                         ndr_interface_name(&p->contexts->syntax.uuid,
+                                            p->contexts->syntax.if_version),
                          (unsigned int)p->out_data.frag.length,
                          (unsigned int)p->out_data.current_pdu_sent,
                          (int)data_returned));
@@ -341,7 +345,8 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data,
 
        DEBUG(10,("read_from_pipe: %s: fault_state = %d : data_sent_length "
                  "= %u, p->out_data.rdata.length = %u.\n",
-                 get_pipe_name_from_syntax(talloc_tos(), &p->contexts->syntax),
+                 ndr_interface_name(&p->contexts->syntax.uuid,
+                                    p->contexts->syntax.if_version),
                  (int)p->fault_state,
                  (unsigned int)p->out_data.data_sent_length,
                  (unsigned int)p->out_data.rdata.length));
@@ -363,7 +368,8 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data,
 
        if(!create_next_pdu(p)) {
                DEBUG(0,("read_from_pipe: %s: create_next_pdu failed.\n",
-                        get_pipe_name_from_syntax(talloc_tos(), &p->contexts->syntax)));
+                        ndr_interface_name(&p->contexts->syntax.uuid,
+                                           p->contexts->syntax.if_version)));
                return -1;
        }
 
index e4417eaa0d29c7935b6e40aa4d75c1ff07cf0447..7a12f17cd892abbc8883923ae6889c1337a06794 100755 (executable)
@@ -672,7 +672,8 @@ bld.SAMBA3_LIBRARY('msrpc3',
                    deps='''ndr ndr-standard
                     RPC_NDR_EPMAPPER NTLMSSP_COMMON COMMON_SCHANNEL LIBCLI_AUTH
                     LIBTSOCKET gse dcerpc-binding
-                    libsmb''',
+                    libsmb
+                    ndr-table''',
                    vars=locals(),
                    private_library=True)