diff options
author | Andreas Schneider <asn@samba.org> | 2014-02-27 09:58:27 +0100 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2014-02-27 16:47:47 +0100 |
commit | 562ade624a78a11a5af0f26b04df93d76d6166bd (patch) | |
tree | dc16840583ad441109a1744ec43583029d643761 /source3 | |
parent | 7d05baa96b5c49629803a98ec8160d2c5c51c839 (diff) | |
download | samba-562ade624a78a11a5af0f26b04df93d76d6166bd.tar.gz samba-562ade624a78a11a5af0f26b04df93d76d6166bd.tar.xz samba-562ade624a78a11a5af0f26b04df93d76d6166bd.zip |
s3-spoolssd: Don't register spoolssd if epmd is not running.
https://bugzilla.samba.org/show_bug.cgi?id=10474
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/printing/spoolssd.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c index 1bf87b30ea..f181fcc3f2 100644 --- a/source3/printing/spoolssd.c +++ b/source3/printing/spoolssd.c @@ -33,6 +33,7 @@ #include "librpc/gen_ndr/srv_spoolss.h" #include "rpc_server/rpc_server.h" #include "rpc_server/rpc_ep_register.h" +#include "rpc_server/rpc_config.h" #include "rpc_server/spoolss/srv_spoolss_nt.h" #include "librpc/rpc/dcerpc_ep.h" #include "lib/server_prefork.h" @@ -631,6 +632,7 @@ static char *get_bq_logfile(void) pid_t start_spoolssd(struct tevent_context *ev_ctx, struct messaging_context *msg_ctx) { + enum rpc_service_mode_e epm_mode = rpc_epmapper_mode(); struct rpc_srv_callbacks spoolss_cb; struct dcerpc_binding_vector *v; TALLOC_CTX *mem_ctx; @@ -778,25 +780,28 @@ pid_t start_spoolssd(struct tevent_context *ev_ctx, exit(1); } - status = dcerpc_binding_vector_new(mem_ctx, &v); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0, ("Failed to create binding vector (%s)\n", - nt_errstr(status))); - exit(1); - } + if (epm_mode != RPC_SERVICE_MODE_DISABLED && + (lp_parm_bool(-1, "rpc_server", "register_embedded_np", false))) { + status = dcerpc_binding_vector_new(mem_ctx, &v); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("Failed to create binding vector (%s)\n", + nt_errstr(status))); + exit(1); + } - status = dcerpc_binding_vector_add_np_default(&ndr_table_spoolss, v); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0, ("Failed to add np to binding vector (%s)\n", - nt_errstr(status))); - exit(1); - } + status = dcerpc_binding_vector_add_np_default(&ndr_table_spoolss, v); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("Failed to add np to binding vector (%s)\n", + nt_errstr(status))); + exit(1); + } - status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_spoolss, v); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0, ("Failed to register spoolss endpoint! (%s)\n", - nt_errstr(status))); - exit(1); + status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_spoolss, v); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("Failed to register spoolss endpoint! (%s)\n", + nt_errstr(status))); + exit(1); + } } talloc_free(mem_ctx); |