summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorSamuel Cabrero <scabrero@suse.de>2021-08-23 14:23:58 +0200
committerVolker Lendecke <vl@samba.org>2021-09-21 10:15:34 +0000
commit99bf0c1b2649f74a3199c59bbc16c6e604ff4e79 (patch)
tree60d8f5ea52561ae9c451575f327b8cc41a9bda8c /pidl
parentb09efc8b8b9f482443a9d99074c6167c08859d84 (diff)
downloadsamba-99bf0c1b2649f74a3199c59bbc16c6e604ff4e79.tar.gz
pidl:NDR/ServerCompat.pm: Do not register disabled services
In samba3 it is possible to disable RPC services, for exapmle: rpc_server:netlogon = disabled If a service is disabled do not register the interface neither create its endpoint. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm
index d1368c3dbca..064bec8aee4 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm
@@ -470,6 +470,14 @@ sub boilerplate_ep_server($)
$self->indent();
$self->pidl("enum dcerpc_transport_t transport = dcerpc_binding_get_transport(binding);");
$self->pidl("");
+ $self->pidl("/* If service is disabled, do not register */");
+ $self->pidl("if (rpc_service_mode(name) == RPC_SERVICE_MODE_DISABLED) {");
+ $self->indent();
+ $self->pidl("return NT_STATUS_NOT_IMPLEMENTED;");
+ $self->deindent();
+ $self->pidl("}");
+
+ $self->pidl("");
$self->pidl("/* If service is embedded, register only for ncacn_np");
$self->pidl(" * see 8466b3c85e4b835e57e41776853093f4a0edc8b8");
$self->pidl(" */");