s4-rpc_server: Improve debug of new endpoints
authorAndrew Bartlett <abartlet@samba.org>
Wed, 26 Jul 2017 23:10:43 +0000 (11:10 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 28 Jul 2017 02:12:08 +0000 (04:12 +0200)
This helps us know what process model is required and what one is in use.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12939

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jul 28 04:12:08 CEST 2017 on sn-devel-144

source4/rpc_server/dcerpc_server.c
source4/rpc_server/service_rpc.c

index d970d4b14777fcc283febf34fbe9dbc3ce8e2aeb..6a985c5c63c0dbc9ec32b6b3a228a538e6974e00 100644 (file)
@@ -275,7 +275,8 @@ _PUBLIC_ NTSTATUS dcesrv_interface_register(struct dcesrv_context *dce_ctx,
        enum dcerpc_transport_t transport;
        char *ep_string = NULL;
        bool use_single_process = true;
-       
+       const char *ep_process_string;
+
        /*
         * If we are not using handles, there is no need for force
         * this service into using a single process.
@@ -444,8 +445,15 @@ _PUBLIC_ NTSTATUS dcesrv_interface_register(struct dcesrv_context *dce_ctx,
        /* Re-get the string as we may have set a port */
        ep_string = dcerpc_binding_string(dce_ctx, ep->ep_description);
 
-       DEBUG(4,("dcesrv_interface_register: interface '%s' registered on endpoint '%s'\n",
-                iface->name, ep_string));
+       if (use_single_process) {
+               ep_process_string = "single process required";
+       } else {
+               ep_process_string = "multi process compatible";
+       }
+
+       DBG_INFO("dcesrv_interface_register: interface '%s' "
+                "registered on endpoint '%s' (%s)\n",
+                iface->name, ep_string, ep_process_string);
        TALLOC_FREE(ep_string);
 
        return NT_STATUS_OK;
index 44c0d53aee6eea2e2d07bf68be71729c9605e172..3ff9f6ff887e72700e4e4a751c72f82bf97720db 100644 (file)
@@ -81,6 +81,10 @@ static void dcesrv_task_init(struct task_server *task)
 
                enum dcerpc_transport_t transport =
                        dcerpc_binding_get_transport(e->ep_description);
+               const char *transport_str
+                       = derpc_transport_string_by_transport(transport);
+
+               struct dcesrv_if_list *iface_list;
 
                /*
                 * Ensure that -Msingle sets e->use_single_process for
@@ -116,6 +120,18 @@ static void dcesrv_task_init(struct task_server *task)
                if (!NT_STATUS_IS_OK(status)) {
                        goto failed;
                }
+
+               DEBUG(5,("Added endpoint on %s "
+                        "using process model %s for",
+                        transport_str,
+                        this_model_ops->name));
+
+               for (iface_list = e->interface_list;
+                    iface_list != NULL;
+                    iface_list = iface_list->next) {
+                       DEBUGADD(5, (" %s", iface_list->iface.name));
+               }
+               DEBUGADD(5, ("\n"));
        }
 
        irpc_add_name(task->msg_ctx, "rpc_server");