s4-rpc_server: Do not check association groups for NETLOGON
authorAndrew Bartlett <abartlet@samba.org>
Sun, 13 Nov 2016 21:11:05 +0000 (10:11 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 20 Dec 2016 00:11:23 +0000 (01:11 +0100)
If this RPC server is not going to use handles (actually a generic
flag) then do not check the assocation group provided.  This in turn
allows us to easily make NETLOGON run in multiple processes.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/rpc_server/dcerpc_server.c

index ca7a006ded751734529e5b21c43a2fa065c2d363..8ed9df5b0b4e45edba44369fe93ad51a82c9db7e 100644 (file)
@@ -816,6 +816,33 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call)
                call->conn->assoc_group = dcesrv_assoc_group_new(call->conn,
                                                                 call->conn->dce_ctx);
        }
+
+       /*
+        * The NETLOGON server does not use handles and so
+        * there is no need to support association groups, but
+        * we need to give back a number regardless.
+        *
+        * We have to do this when it is not run as a single process,
+        * because then it can't see the other valid association
+        * groups.  We handle this genericly for all endpoints not
+        * running in single process mode.
+        *
+        * We know which endpoint we are on even before checking the
+        * iface UUID, so for simplicity we enforce the same policy
+        * for all interfaces on the endpoint.
+        *
+        * This means that where NETLOGON
+        * shares an endpoint (such as ncalrpc or of 'lsa over
+        * netlogon' is set) we will still check association groups.
+        *
+        */
+
+       if (call->conn->assoc_group == NULL &&
+           !call->conn->endpoint->use_single_process) {
+               call->conn->assoc_group
+                       = dcesrv_assoc_group_new(call->conn,
+                                                call->conn->dce_ctx);
+       }
        if (call->conn->assoc_group == NULL) {
                return dcesrv_bind_nak(call, 0);
        }