The branch, master has been updated
       via  074ee6f s3-rpc_server: Remove remaining code for embedded endpoint 
mapper
       via  be7bcf0 s3-rpc_server: Only init and register embedded RPC services 
in dcesrv_ep_setup()
      from  cae455f s3: Fix a "Invalid (state->nread >= 0)" warning

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 074ee6f34c3c105d7c5d940b420ccd785c05867e
Author: Andrew Bartlett <[email protected]>
Date:   Sat Mar 3 12:49:10 2012 +1100

    s3-rpc_server: Remove remaining code for embedded endpoint mapper
    
    Signed-off-by: Andreas Schneider <[email protected]>
    
    Autobuild-User: Andreas Schneider <[email protected]>
    Autobuild-Date: Mon Mar  5 23:14:33 CET 2012 on sn-devel-104

commit be7bcf0e550229eb5ee15c65d3f50b8ddd5e9dff
Author: Andrew Bartlett <[email protected]>
Date:   Mon Mar 5 10:59:01 2012 +1100

    s3-rpc_server: Only init and register embedded RPC services in 
dcesrv_ep_setup()
    
    This consults the two definitions for embedded, that is if the deamon is 
forking
    or if the rpc_server:<interface> line is set to embedded.
    
    Andrew Bartlett
    
    Signed-off-by: Andreas Schneider <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 source3/rpc_server/rpc_service_setup.c |  126 +++++++++++++++++---------------
 1 files changed, 66 insertions(+), 60 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/rpc_service_setup.c 
b/source3/rpc_server/rpc_service_setup.c
index fc770c5..203eeb1 100644
--- a/source3/rpc_server/rpc_service_setup.c
+++ b/source3/rpc_server/rpc_service_setup.c
@@ -53,24 +53,6 @@
 #include "rpc_server/rpc_config.h"
 #include "rpc_server/epmapper/srv_epmapper.h"
 
-static bool rpc_setup_epmapper(struct tevent_context *ev_ctx,
-                              struct messaging_context *msg_ctx)
-{
-       enum rpc_service_mode_e epm_mode = rpc_epmapper_mode();
-       enum rpc_daemon_type_e epm_type = rpc_epmapper_daemon();
-       NTSTATUS status;
-
-       if (epm_mode != RPC_SERVICE_MODE_DISABLED &&
-           epm_type != RPC_DAEMON_DISABLED) {
-               status = rpc_epmapper_init(NULL);
-               if (!NT_STATUS_IS_OK(status)) {
-                       return false;
-               }
-       }
-
-       return true;
-}
-
 /* Common routine for embedded RPC servers */
 static bool rpc_setup_embedded(struct tevent_context *ev_ctx,
                               struct messaging_context *msg_ctx,
@@ -140,6 +122,10 @@ static bool rpc_setup_winreg(struct tevent_context *ev_ctx,
        const struct ndr_interface_table *t = &ndr_table_winreg;
        const char *pipe_name = "winreg";
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED) {
+               return true;
+       }
 
        status = rpc_winreg_init(NULL);
        if (!NT_STATUS_IS_OK(status)) {
@@ -156,6 +142,10 @@ static bool rpc_setup_srvsvc(struct tevent_context *ev_ctx,
        const struct ndr_interface_table *t = &ndr_table_srvsvc;
        const char *pipe_name = "srvsvc";
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED) {
+               return true;
+       }
 
        status = rpc_srvsvc_init(NULL);
        if (!NT_STATUS_IS_OK(status)) {
@@ -171,20 +161,19 @@ static bool rpc_setup_lsarpc(struct tevent_context 
*ev_ctx,
 {
        const struct ndr_interface_table *t = &ndr_table_lsarpc;
        const char *pipe_name = "lsarpc";
-       enum rpc_service_mode_e lsarpc_mode = rpc_lsarpc_mode();
        enum rpc_daemon_type_e lsasd_type = rpc_lsasd_daemon();
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED || lsasd_type != 
RPC_DAEMON_EMBEDDED) {
+               return true;
+       }
 
        status = rpc_lsarpc_init(NULL);
        if (!NT_STATUS_IS_OK(status)) {
                return false;
        }
 
-       if (lsarpc_mode == RPC_SERVICE_MODE_EMBEDDED &&
-           lsasd_type != RPC_DAEMON_DISABLED) {
-               return rpc_setup_embedded(ev_ctx, msg_ctx, v, t, pipe_name);
-       }
-       return true;
+       return rpc_setup_embedded(ev_ctx, msg_ctx, v, t, pipe_name);
 }
 
 static bool rpc_setup_samr(struct tevent_context *ev_ctx,
@@ -193,21 +182,19 @@ static bool rpc_setup_samr(struct tevent_context *ev_ctx,
 {
        const struct ndr_interface_table *t = &ndr_table_samr;
        const char *pipe_name = "samr";
-       enum rpc_service_mode_e samr_mode = rpc_samr_mode();
        enum rpc_daemon_type_e lsasd_type = rpc_lsasd_daemon();
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED || lsasd_type != 
RPC_DAEMON_EMBEDDED) {
+               return true;
+       }
 
        status = rpc_samr_init(NULL);
        if (!NT_STATUS_IS_OK(status)) {
                return false;
        }
 
-       if (samr_mode == RPC_SERVICE_MODE_EMBEDDED &&
-           lsasd_type != RPC_DAEMON_DISABLED) {
-               return rpc_setup_embedded(ev_ctx, msg_ctx, v, t, pipe_name);
-       }
-
-       return true;
+       return rpc_setup_embedded(ev_ctx, msg_ctx, v, t, pipe_name);
 }
 
 static bool rpc_setup_netlogon(struct tevent_context *ev_ctx,
@@ -216,21 +203,19 @@ static bool rpc_setup_netlogon(struct tevent_context 
*ev_ctx,
 {
        const struct ndr_interface_table *t = &ndr_table_netlogon;
        const char *pipe_name = "netlogon";
-       enum rpc_service_mode_e netlogon_mode = rpc_netlogon_mode();
        enum rpc_daemon_type_e lsasd_type = rpc_lsasd_daemon();
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED || lsasd_type != 
RPC_DAEMON_EMBEDDED) {
+               return true;
+       }
 
        status = rpc_netlogon_init(NULL);
        if (!NT_STATUS_IS_OK(status)) {
                return false;
        }
 
-       if (netlogon_mode == RPC_SERVICE_MODE_EMBEDDED &&
-           lsasd_type != RPC_DAEMON_DISABLED) {
-               return rpc_setup_embedded(ev_ctx, msg_ctx, v, t, pipe_name);
-       }
-
-       return true;
+       return rpc_setup_embedded(ev_ctx, msg_ctx, v, t, pipe_name);
 }
 
 static bool rpc_setup_netdfs(struct tevent_context *ev_ctx,
@@ -240,6 +225,10 @@ static bool rpc_setup_netdfs(struct tevent_context *ev_ctx,
        const struct ndr_interface_table *t = &ndr_table_netdfs;
        const char *pipe_name = "netdfs";
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED) {
+               return true;
+       }
 
        status = rpc_netdfs_init(NULL);
        if (!NT_STATUS_IS_OK(status)) {
@@ -257,6 +246,10 @@ static bool rpc_setup_rpcecho(struct tevent_context 
*ev_ctx,
        const struct ndr_interface_table *t = &ndr_table_rpcecho;
        const char *pipe_name = "rpcecho";
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED) {
+               return true;
+       }
 
        status = rpc_rpcecho_init(NULL);
        if (!NT_STATUS_IS_OK(status)) {
@@ -274,6 +267,10 @@ static bool rpc_setup_dssetup(struct tevent_context 
*ev_ctx,
        const struct ndr_interface_table *t = &ndr_table_dssetup;
        const char *pipe_name = "dssetup";
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED) {
+               return true;
+       }
 
        status = rpc_dssetup_init(NULL);
        if (!NT_STATUS_IS_OK(status)) {
@@ -290,6 +287,10 @@ static bool rpc_setup_wkssvc(struct tevent_context *ev_ctx,
        const struct ndr_interface_table *t = &ndr_table_wkssvc;
        const char *pipe_name = "wkssvc";
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED) {
+               return true;
+       }
 
        status = rpc_wkssvc_init(NULL);
        if (!NT_STATUS_IS_OK(status)) {
@@ -328,34 +329,28 @@ static bool rpc_setup_spoolss(struct tevent_context 
*ev_ctx,
 {
        const struct ndr_interface_table *t = &ndr_table_spoolss;
        struct rpc_srv_callbacks spoolss_cb;
-       enum rpc_service_mode_e spoolss_mode = rpc_spoolss_mode();
        enum rpc_daemon_type_e spoolss_type = rpc_spoolss_daemon();
        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
 
-       if (_lp_disable_spoolss() ||
-           spoolss_type == RPC_DAEMON_DISABLED ||
-           spoolss_mode == RPC_SERVICE_MODE_DISABLED) {
+       if (_lp_disable_spoolss()) {
                return true;
        }
 
-       if (spoolss_type == RPC_DAEMON_EMBEDDED) {
-               spoolss_cb.init         = spoolss_init_cb;
-               spoolss_cb.shutdown     = spoolss_shutdown_cb;
-               spoolss_cb.private_data = msg_ctx;
-
-               status = rpc_spoolss_init(&spoolss_cb);
-       } else if (spoolss_type == RPC_DAEMON_FORK) {
-               status = rpc_spoolss_init(NULL);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED || spoolss_type != 
RPC_DAEMON_EMBEDDED) {
+               return true;
        }
+
+       spoolss_cb.init         = spoolss_init_cb;
+       spoolss_cb.shutdown     = spoolss_shutdown_cb;
+       spoolss_cb.private_data = msg_ctx;
+
+       status = rpc_spoolss_init(&spoolss_cb);
        if (!NT_STATUS_IS_OK(status)) {
                return false;
        }
 
-       if (spoolss_type == RPC_DAEMON_EMBEDDED) {
-               return rpc_setup_embedded(ev_ctx, msg_ctx, NULL, t, NULL);
-       }
-
-       return true;
+       return rpc_setup_embedded(ev_ctx, msg_ctx, NULL, t, NULL);
 }
 
 static bool svcctl_init_cb(void *ptr)
@@ -389,6 +384,10 @@ static bool rpc_setup_svcctl(struct tevent_context *ev_ctx,
        const char *pipe_name = "svcctl";
        struct rpc_srv_callbacks svcctl_cb;
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED) {
+               return true;
+       }
 
        svcctl_cb.init         = svcctl_init_cb;
        svcctl_cb.shutdown     = svcctl_shutdown_cb;
@@ -407,6 +406,10 @@ static bool rpc_setup_ntsvcs(struct tevent_context *ev_ctx,
 {
        const struct ndr_interface_table *t = &ndr_table_ntsvcs;
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED) {
+               return true;
+       }
 
        status = rpc_ntsvcs_init(NULL);
        if (!NT_STATUS_IS_OK(status)) {
@@ -438,6 +441,10 @@ static bool rpc_setup_eventlog(struct tevent_context 
*ev_ctx,
        const struct ndr_interface_table *t = &ndr_table_eventlog;
        struct rpc_srv_callbacks eventlog_cb;
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED) {
+               return true;
+       }
 
        eventlog_cb.init         = eventlog_init_cb;
        eventlog_cb.shutdown     = NULL;
@@ -456,6 +463,10 @@ static bool rpc_setup_initshutdown(struct tevent_context 
*ev_ctx,
 {
        const struct ndr_interface_table *t = &ndr_table_initshutdown;
        NTSTATUS status;
+       enum rpc_service_mode_e service_mode = rpc_service_mode(t->name);
+       if (service_mode != RPC_SERVICE_MODE_EMBEDDED) {
+               return true;
+       }
 
        status = rpc_initshutdown_init(NULL);
        if (!NT_STATUS_IS_OK(status)) {
@@ -487,11 +498,6 @@ bool dcesrv_ep_setup(struct tevent_context *ev_ctx,
                goto done;
        }
 
-       ok = rpc_setup_epmapper(ev_ctx, msg_ctx);
-       if (!ok) {
-               goto done;
-       }
-
        rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
                                           "rpc_server",
                                           "tcpip",


-- 
Samba Shared Repository

Reply via email to