summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--selftest/target/Samba3.pm2
-rw-r--r--source3/rpc_server/srv_rpc_register.c30
-rwxr-xr-xsource3/script/tests/selftest.sh2
3 files changed, 32 insertions, 2 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 3104e49d5f..a0a13f9c72 100644
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -556,6 +556,8 @@ sub provision($$$$$$)
queue resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queueresume %p
lpq cache time = 0
+ rpc_server:epmapper = embedded
+
# Begin extra options
$extra_options
# End extra options
diff --git a/source3/rpc_server/srv_rpc_register.c b/source3/rpc_server/srv_rpc_register.c
index b3e563dd3b..73e2dc766d 100644
--- a/source3/rpc_server/srv_rpc_register.c
+++ b/source3/rpc_server/srv_rpc_register.c
@@ -48,6 +48,15 @@ static NTSTATUS _rpc_ep_register(const struct ndr_interface_table *iface,
{
struct dcerpc_binding_vector *v = NULL;
NTSTATUS status;
+ const char *rpcsrv_type;
+
+ /* start endpoint mapper only if enabled */
+ rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
+ "rpc_server", "epmapper",
+ "none");
+ if (StrCaseCmp(rpcsrv_type, "none") == 0) {
+ return NT_STATUS_OK;
+ }
status = dcerpc_binding_vector_create(talloc_tos(),
iface,
@@ -71,6 +80,15 @@ static NTSTATUS _rpc_ep_unregister(const struct ndr_interface_table *iface)
{
struct dcerpc_binding_vector *v = NULL;
NTSTATUS status;
+ const char *rpcsrv_type;
+
+ /* start endpoint mapper only if enabled */
+ rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
+ "rpc_server", "epmapper",
+ "none");
+ if (StrCaseCmp(rpcsrv_type, "none") == 0) {
+ return NT_STATUS_OK;
+ }
status = dcerpc_binding_vector_create(talloc_tos(),
iface,
@@ -265,8 +283,16 @@ bool srv_rpc_register(struct messaging_context *msg_ctx) {
struct rpc_srv_callbacks dssetup_cb;
struct rpc_srv_callbacks wkssvc_cb;
- if (!NT_STATUS_IS_OK(rpc_epmapper_init(NULL))) {
- return false;
+ const char *rpcsrv_type;
+
+ /* start endpoint mapper only if enabled */
+ rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
+ "rpc_server", "epmapper",
+ "none");
+ if (StrCaseCmp(rpcsrv_type, "embedded") == 0) {
+ if (!NT_STATUS_IS_OK(rpc_epmapper_init(NULL))) {
+ return false;
+ }
}
winreg_cb.init = winreg_init_cb;
diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh
index 17bb5fe41a..3da4fac8ff 100755
--- a/source3/script/tests/selftest.sh
+++ b/source3/script/tests/selftest.sh
@@ -343,6 +343,8 @@ cat >$SERVERCONFFILE<<EOF
queue resume command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb queueresume %p
lpq cache time = 0
+ rpc_server:epmapper = embedded
+
#Include user defined custom parameters if set
$INCLUDE_CUSTOM_CONF