summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-07-14 10:37:49 +0200
committerAndreas Schneider <asn@samba.org>2011-08-01 11:08:36 +0200
commit9c5f2ec12136eac5ede41ccef581b2bf934429ca (patch)
tree33245fdac7dfab35122930c9e22a037acdf09374
parente0931a53c894e9d267c2d4b5d1b667209f9540ab (diff)
downloadsamba-9c5f2ec12136eac5ede41ccef581b2bf934429ca.tar.gz
samba-9c5f2ec12136eac5ede41ccef581b2bf934429ca.tar.bz2
samba-9c5f2ec12136eac5ede41ccef581b2bf934429ca.zip
s3-rpc_server: Disable listening on tcpip ports by default.
-rw-r--r--selftest/target/Samba3.pm2
-rw-r--r--source3/rpc_server/rpc_service_setup.c25
2 files changed, 19 insertions, 8 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 418240b061..c45c8789c2 100644
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -285,6 +285,7 @@ sub setup_plugin_s4_dc($$$$)
auth methods = guest samba4
domain logons = yes
rpc_server:epmapper = external
+ rpc_server:tcpip = no
rpc_server:lsass = external
rpc_server:lsarpc = external
rpc_server:netlogon = external
@@ -901,6 +902,7 @@ sub provision($$$$$$$)
ncalrpc dir = $prefix_abs/ncalrpc
rpc_server:epmapper = daemon
+ rpc_server:tcpip = yes
resolv:host file = $dns_host_file
diff --git a/source3/rpc_server/rpc_service_setup.c b/source3/rpc_server/rpc_service_setup.c
index f5716cdab9..a9633fb355 100644
--- a/source3/rpc_server/rpc_service_setup.c
+++ b/source3/rpc_server/rpc_service_setup.c
@@ -972,6 +972,7 @@ bool dcesrv_ep_setup(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx)
{
struct dcerpc_binding_vector *v;
+ const char *rpcsrv_type;
TALLOC_CTX *tmp_ctx;
NTSTATUS status;
bool ok;
@@ -993,14 +994,22 @@ bool dcesrv_ep_setup(struct tevent_context *ev_ctx,
goto done;
}
- status = rpc_setup_tcpip_sockets(ev_ctx,
- msg_ctx,
- &ndr_table_winreg,
- v,
- 0);
- if (!NT_STATUS_IS_OK(status)) {
- ok = false;
- goto done;
+ rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
+ "rpc_server",
+ "tcpip",
+ "no");
+
+ if (strcasecmp_m(rpcsrv_type, "yes") == 0 ||
+ strcasecmp_m(rpcsrv_type, "true") == 0) {
+ status = rpc_setup_tcpip_sockets(ev_ctx,
+ msg_ctx,
+ &ndr_table_winreg,
+ v,
+ 0);
+ if (!NT_STATUS_IS_OK(status)) {
+ ok = false;
+ goto done;
+ }
}
ok = rpc_setup_winreg(ev_ctx, msg_ctx, v);