2 * Unix SMB/CIFS implementation.
4 * SMBD RPC service callbacks
6 * Copyright (c) 2011 Andreas Schneider <asn@samba.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
25 #include "../librpc/gen_ndr/ndr_epmapper_c.h"
26 #include "../librpc/gen_ndr/srv_epmapper.h"
27 #include "../librpc/gen_ndr/srv_srvsvc.h"
28 #include "../librpc/gen_ndr/srv_winreg.h"
29 #include "../librpc/gen_ndr/srv_dfs.h"
30 #include "../librpc/gen_ndr/srv_dssetup.h"
31 #include "../librpc/gen_ndr/srv_echo.h"
32 #include "../librpc/gen_ndr/srv_eventlog.h"
33 #include "../librpc/gen_ndr/srv_initshutdown.h"
34 #include "../librpc/gen_ndr/srv_lsa.h"
35 #include "../librpc/gen_ndr/srv_netlogon.h"
36 #include "../librpc/gen_ndr/srv_ntsvcs.h"
37 #include "../librpc/gen_ndr/srv_samr.h"
38 #include "../librpc/gen_ndr/srv_spoolss.h"
39 #include "../librpc/gen_ndr/srv_svcctl.h"
40 #include "../librpc/gen_ndr/srv_wkssvc.h"
42 #include "printing/nt_printing_migrate.h"
43 #include "rpc_server/eventlog/srv_eventlog_reg.h"
44 #include "rpc_server/svcctl/srv_svcctl_reg.h"
45 #include "rpc_server/spoolss/srv_spoolss_nt.h"
46 #include "rpc_server/svcctl/srv_svcctl_nt.h"
48 #include "librpc/rpc/dcerpc_ep.h"
50 #include "rpc_server/rpc_ep_setup.h"
51 #include "rpc_server/rpc_server.h"
52 #include "rpc_server/epmapper/srv_epmapper.h"
54 struct dcesrv_ep_context {
55 struct tevent_context *ev_ctx;
56 struct messaging_context *msg_ctx;
59 static uint16_t _open_sockets(struct tevent_context *ev_ctx,
60 struct messaging_context *msg_ctx,
61 struct ndr_syntax_id syntax_id,
64 uint32_t num_ifs = iface_count();
68 if (lp_interfaces() && lp_bind_interfaces_only()) {
70 * We have been given an interfaces line, and been told to only
71 * bind to those interfaces. Create a socket per interface and
75 /* Now open a listen socket for each of the interfaces. */
76 for(i = 0; i < num_ifs; i++) {
77 const struct sockaddr_storage *ifss =
78 iface_n_sockaddr_storage(i);
80 p = setup_dcerpc_ncacn_tcpip_socket(ev_ctx,
91 const char *sock_addr = lp_socket_address();
95 if (strequal(sock_addr, "0.0.0.0") ||
96 strequal(sock_addr, "::")) {
100 sock_addr = "0.0.0.0";
104 for (sock_ptr = sock_addr;
105 next_token_talloc(talloc_tos(), &sock_ptr, &sock_tok, " \t,");
107 struct sockaddr_storage ss;
109 /* open an incoming socket */
110 if (!interpret_string_addr(&ss,
112 AI_NUMERICHOST|AI_PASSIVE)) {
116 p = setup_dcerpc_ncacn_tcpip_socket(ev_ctx,
131 static void rpc_ep_setup_register_loop(struct tevent_req *subreq);
132 static NTSTATUS rpc_ep_setup_try_register(TALLOC_CTX *mem_ctx,
133 struct tevent_context *ev_ctx,
134 struct messaging_context *msg_ctx,
135 const struct ndr_interface_table *iface,
138 struct dcerpc_binding_handle **pbh);
140 struct rpc_ep_regsiter_state {
141 struct dcerpc_binding_handle *h;
144 struct tevent_context *ev_ctx;
145 struct messaging_context *msg_ctx;
147 const struct ndr_interface_table *iface;
155 NTSTATUS rpc_ep_setup_register(struct tevent_context *ev_ctx,
156 struct messaging_context *msg_ctx,
157 const struct ndr_interface_table *iface,
161 struct rpc_ep_regsiter_state *state;
162 struct tevent_req *req;
164 state = talloc(ev_ctx, struct rpc_ep_regsiter_state);
166 return NT_STATUS_NO_MEMORY;
169 state->mem_ctx = talloc_named(state,
173 if (state->mem_ctx == NULL) {
175 return NT_STATUS_NO_MEMORY;
178 state->wait_time = 1;
179 state->ev_ctx = ev_ctx;
180 state->msg_ctx = msg_ctx;
181 state->iface = iface;
182 state->ncalrpc = talloc_strdup(state, ncalrpc);
185 req = tevent_wakeup_send(state->mem_ctx,
187 timeval_current_ofs(1, 0));
188 if (tevent_req_nomem(state->mem_ctx, req)) {
190 return NT_STATUS_NO_MEMORY;
193 tevent_req_set_callback(req, rpc_ep_setup_register_loop, state);
198 #define MONITOR_WAIT_TIME 15
199 static void rpc_ep_setup_monitor_loop(struct tevent_req *subreq);
201 static void rpc_ep_setup_register_loop(struct tevent_req *subreq)
203 struct rpc_ep_regsiter_state *state =
204 tevent_req_callback_data(subreq, struct rpc_ep_regsiter_state);
208 ok = tevent_wakeup_recv(subreq);
215 status = rpc_ep_setup_try_register(state->mem_ctx,
222 if (NT_STATUS_IS_OK(status)) {
223 /* endpoint registered, monitor the connnection. */
224 subreq = tevent_wakeup_send(state->mem_ctx,
226 timeval_current_ofs(MONITOR_WAIT_TIME, 0));
227 if (tevent_req_nomem(state->mem_ctx, subreq)) {
232 tevent_req_set_callback(subreq, rpc_ep_setup_monitor_loop, state);
236 state->wait_time = state->wait_time * 2;
237 if (state->wait_time > 16) {
238 DEBUG(0, ("Failed to register endpoint '%s'!\n",
239 state->iface->name));
240 state->wait_time = 16;
243 subreq = tevent_wakeup_send(state->mem_ctx,
245 timeval_current_ofs(state->wait_time, 0));
246 if (tevent_req_nomem(state->mem_ctx, subreq)) {
251 tevent_req_set_callback(subreq, rpc_ep_setup_register_loop, state);
255 static NTSTATUS rpc_ep_setup_try_register(TALLOC_CTX *mem_ctx,
256 struct tevent_context *ev_ctx,
257 struct messaging_context *msg_ctx,
258 const struct ndr_interface_table *iface,
261 struct dcerpc_binding_handle **pbh)
263 struct dcerpc_binding_vector *v = NULL;
266 status = dcerpc_binding_vector_create(mem_ctx,
271 if (!NT_STATUS_IS_OK(status)) {
275 status = dcerpc_ep_register(mem_ctx,
278 &iface->syntax_id.uuid,
282 if (!NT_STATUS_IS_OK(status)) {
290 * Monitor the connection to the endpoint mapper and if it goes away, try to
291 * register the endpoint.
293 static void rpc_ep_setup_monitor_loop(struct tevent_req *subreq)
295 struct rpc_ep_regsiter_state *state =
296 tevent_req_callback_data(subreq, struct rpc_ep_regsiter_state);
297 struct policy_handle entry_handle;
298 struct dcerpc_binding map_binding;
299 struct epm_twr_p_t towers[10];
300 struct epm_twr_t *map_tower;
301 uint32_t num_towers = 0;
304 uint32_t result = EPMAPPER_STATUS_CANT_PERFORM_OP;
309 ZERO_STRUCT(entry_handle);
311 tmp_ctx = talloc_stackframe();
312 if (tmp_ctx == NULL) {
317 ok = tevent_wakeup_recv(subreq);
324 /* Create map tower */
325 map_binding.transport = NCACN_NP;
326 map_binding.object = state->iface->syntax_id;
327 map_binding.host = "";
328 map_binding.endpoint = "";
330 map_tower = talloc_zero(tmp_ctx, struct epm_twr_t);
331 if (map_tower == NULL) {
332 talloc_free(tmp_ctx);
337 status = dcerpc_binding_build_tower(map_tower, &map_binding,
339 if (!NT_STATUS_IS_OK(status)) {
340 talloc_free(tmp_ctx);
346 status = dcerpc_epm_Map(state->h,
355 if (NT_STATUS_IS_OK(status)) {
358 if (result == EPMAPPER_STATUS_OK ||
359 result == EPMAPPER_STATUS_NO_MORE_ENTRIES) {
362 if (num_towers == 0) {
366 talloc_free(tmp_ctx);
368 subreq = tevent_wakeup_send(state->mem_ctx,
370 timeval_current_ofs(MONITOR_WAIT_TIME, 0));
371 if (tevent_req_nomem(state->mem_ctx, subreq)) {
377 tevent_req_set_callback(subreq, rpc_ep_setup_monitor_loop, state);
379 TALLOC_FREE(state->h);
380 state->wait_time = 1;
382 tevent_req_set_callback(subreq, rpc_ep_setup_register_loop, state);
388 static bool epmapper_init_cb(void *ptr)
390 struct dcesrv_ep_context *ep_ctx =
391 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
394 port = _open_sockets(ep_ctx->ev_ctx,
396 ndr_table_epmapper.syntax_id,
405 static bool epmapper_shutdown_cb(void *ptr)
407 srv_epmapper_cleanup();
412 static bool winreg_init_cb(void *ptr)
414 struct dcesrv_ep_context *ep_ctx =
415 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
416 struct ndr_syntax_id abstract_syntax = ndr_table_winreg.syntax_id;
417 const char *pipe_name = "winreg";
418 const char *rpcsrv_type;
421 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
426 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
427 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
431 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
439 port = _open_sockets(ep_ctx->ev_ctx,
447 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
452 if (!NT_STATUS_IS_OK(status)) {
460 static bool srvsvc_init_cb(void *ptr)
462 struct dcesrv_ep_context *ep_ctx =
463 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
464 struct ndr_syntax_id abstract_syntax = ndr_table_srvsvc.syntax_id;
465 const char *pipe_name = "srvsvc";
466 const char *rpcsrv_type;
469 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
474 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
475 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
479 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
488 port = _open_sockets(ep_ctx->ev_ctx,
496 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
501 if (!NT_STATUS_IS_OK(status)) {
509 static bool lsarpc_init_cb(void *ptr)
511 struct dcesrv_ep_context *ep_ctx =
512 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
513 struct ndr_syntax_id abstract_syntax = ndr_table_lsarpc.syntax_id;
514 const char *pipe_name = "lsarpc";
515 const char *rpcsrv_type;
518 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
523 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
524 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
528 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
537 port = _open_sockets(ep_ctx->ev_ctx,
545 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
550 if (!NT_STATUS_IS_OK(status)) {
558 static bool samr_init_cb(void *ptr)
560 struct dcesrv_ep_context *ep_ctx =
561 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
562 struct ndr_syntax_id abstract_syntax = ndr_table_samr.syntax_id;
563 const char *pipe_name = "samr";
564 const char *rpcsrv_type;
567 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
572 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
573 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
577 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
586 port = _open_sockets(ep_ctx->ev_ctx,
594 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
599 if (!NT_STATUS_IS_OK(status)) {
607 static bool netlogon_init_cb(void *ptr)
609 struct dcesrv_ep_context *ep_ctx =
610 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
611 struct ndr_syntax_id abstract_syntax = ndr_table_netlogon.syntax_id;
612 const char *pipe_name = "netlogon";
613 const char *rpcsrv_type;
616 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
621 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
622 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
626 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
635 port = _open_sockets(ep_ctx->ev_ctx,
643 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
648 if (!NT_STATUS_IS_OK(status)) {
656 static bool spoolss_init_cb(void *ptr)
658 struct dcesrv_ep_context *ep_ctx =
659 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
660 const char *rpcsrv_type;
663 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
669 * Migrate the printers first.
671 ok = nt_printing_tdb_migrate(ep_ctx->msg_ctx);
676 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
677 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
680 status =rpc_ep_setup_register(ep_ctx->ev_ctx,
685 if (!NT_STATUS_IS_OK(status)) {
693 static bool spoolss_shutdown_cb(void *ptr)
695 srv_spoolss_cleanup();
700 static bool svcctl_init_cb(void *ptr)
702 struct dcesrv_ep_context *ep_ctx =
703 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
704 const char *rpcsrv_type;
707 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
712 ok = svcctl_init_winreg(ep_ctx->msg_ctx);
717 /* initialize the control hooks */
718 init_service_op_table();
720 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
721 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
724 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
729 if (!NT_STATUS_IS_OK(status)) {
737 static bool svcctl_shutdown_cb(void *ptr)
739 shutdown_service_op_table();
744 static bool ntsvcs_init_cb(void *ptr)
746 struct dcesrv_ep_context *ep_ctx =
747 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
748 const char *rpcsrv_type;
750 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
755 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
756 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
759 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
764 if (!NT_STATUS_IS_OK(status)) {
772 static bool eventlog_init_cb(void *ptr)
774 struct dcesrv_ep_context *ep_ctx =
775 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
776 const char *rpcsrv_type;
779 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
784 ok = eventlog_init_winreg(ep_ctx->msg_ctx);
789 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
790 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
793 status =rpc_ep_setup_register(ep_ctx->ev_ctx,
798 if (!NT_STATUS_IS_OK(status)) {
806 static bool initshutdown_init_cb(void *ptr)
808 struct dcesrv_ep_context *ep_ctx =
809 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
810 const char *rpcsrv_type;
812 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
817 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
818 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
821 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
823 &ndr_table_initshutdown,
826 if (!NT_STATUS_IS_OK(status)) {
835 static bool rpcecho_init_cb(void *ptr) {
836 struct dcesrv_ep_context *ep_ctx =
837 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
838 const char *rpcsrv_type;
841 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
846 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
847 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
850 port = _open_sockets(ep_ctx->ev_ctx,
852 ndr_table_rpcecho.syntax_id,
858 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
863 if (!NT_STATUS_IS_OK(status)) {
873 static bool netdfs_init_cb(void *ptr)
875 struct dcesrv_ep_context *ep_ctx =
876 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
877 struct ndr_syntax_id abstract_syntax = ndr_table_netdfs.syntax_id;
878 const char *pipe_name = "netdfs";
879 const char *rpcsrv_type;
882 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
886 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
887 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
891 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
900 port = _open_sockets(ep_ctx->ev_ctx,
908 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
913 if (!NT_STATUS_IS_OK(status)) {
921 static bool dssetup_init_cb(void *ptr)
923 struct dcesrv_ep_context *ep_ctx =
924 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
925 struct ndr_syntax_id abstract_syntax = ndr_table_dssetup.syntax_id;
926 const char *pipe_name = "dssetup";
927 const char *rpcsrv_type;
930 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
935 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
936 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
940 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
949 port = _open_sockets(ep_ctx->ev_ctx,
957 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
962 if (!NT_STATUS_IS_OK(status)) {
970 static bool wkssvc_init_cb(void *ptr)
972 struct dcesrv_ep_context *ep_ctx =
973 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
974 struct ndr_syntax_id abstract_syntax = ndr_table_wkssvc.syntax_id;
975 const char *pipe_name = "wkssvc";
976 const char *rpcsrv_type;
979 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
983 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
984 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
988 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
997 port = _open_sockets(ep_ctx->ev_ctx,
1005 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
1010 if (!NT_STATUS_IS_OK(status)) {
1018 bool dcesrv_ep_setup(struct tevent_context *ev_ctx,
1019 struct messaging_context *msg_ctx)
1021 struct dcesrv_ep_context *ep_ctx;
1023 struct rpc_srv_callbacks epmapper_cb;
1025 struct rpc_srv_callbacks winreg_cb;
1026 struct rpc_srv_callbacks srvsvc_cb;
1028 struct rpc_srv_callbacks lsarpc_cb;
1029 struct rpc_srv_callbacks samr_cb;
1030 struct rpc_srv_callbacks netlogon_cb;
1032 struct rpc_srv_callbacks spoolss_cb;
1033 struct rpc_srv_callbacks svcctl_cb;
1034 struct rpc_srv_callbacks ntsvcs_cb;
1035 struct rpc_srv_callbacks eventlog_cb;
1036 struct rpc_srv_callbacks initshutdown_cb;
1037 struct rpc_srv_callbacks netdfs_cb;
1039 struct rpc_srv_callbacks rpcecho_cb;
1041 struct rpc_srv_callbacks dssetup_cb;
1042 struct rpc_srv_callbacks wkssvc_cb;
1044 const char *rpcsrv_type;
1046 ep_ctx = talloc(ev_ctx, struct dcesrv_ep_context);
1047 if (ep_ctx == NULL) {
1051 ep_ctx->ev_ctx = ev_ctx;
1052 ep_ctx->msg_ctx = msg_ctx;
1054 /* start endpoint mapper only if enabled */
1055 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
1059 if (StrCaseCmp(rpcsrv_type, "embedded") == 0) {
1060 epmapper_cb.init = epmapper_init_cb;
1061 epmapper_cb.shutdown = epmapper_shutdown_cb;
1062 epmapper_cb.private_data = ep_ctx;
1064 if (!NT_STATUS_IS_OK(rpc_epmapper_init(&epmapper_cb))) {
1067 } else if (StrCaseCmp(rpcsrv_type, "daemon") == 0) {
1068 if (!NT_STATUS_IS_OK(rpc_epmapper_init(NULL))) {
1073 winreg_cb.init = winreg_init_cb;
1074 winreg_cb.shutdown = NULL;
1075 winreg_cb.private_data = ep_ctx;
1076 if (!NT_STATUS_IS_OK(rpc_winreg_init(&winreg_cb))) {
1080 srvsvc_cb.init = srvsvc_init_cb;
1081 srvsvc_cb.shutdown = NULL;
1082 srvsvc_cb.private_data = ep_ctx;
1083 if (!NT_STATUS_IS_OK(rpc_srvsvc_init(&srvsvc_cb))) {
1088 lsarpc_cb.init = lsarpc_init_cb;
1089 lsarpc_cb.shutdown = NULL;
1090 lsarpc_cb.private_data = ep_ctx;
1091 if (!NT_STATUS_IS_OK(rpc_lsarpc_init(&lsarpc_cb))) {
1095 samr_cb.init = samr_init_cb;
1096 samr_cb.shutdown = NULL;
1097 samr_cb.private_data = ep_ctx;
1098 if (!NT_STATUS_IS_OK(rpc_samr_init(&samr_cb))) {
1102 netlogon_cb.init = netlogon_init_cb;
1103 netlogon_cb.shutdown = NULL;
1104 netlogon_cb.private_data = ep_ctx;
1105 if (!NT_STATUS_IS_OK(rpc_netlogon_init(&netlogon_cb))) {
1109 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
1113 if (StrCaseCmp(rpcsrv_type, "embedded") == 0) {
1114 spoolss_cb.init = spoolss_init_cb;
1115 spoolss_cb.shutdown = spoolss_shutdown_cb;
1116 spoolss_cb.private_data = ep_ctx;
1117 if (!NT_STATUS_IS_OK(rpc_spoolss_init(&spoolss_cb))) {
1120 } else if (StrCaseCmp(rpcsrv_type, "daemon") == 0 ||
1121 StrCaseCmp(rpcsrv_type, "external") == 0) {
1122 if (!NT_STATUS_IS_OK(rpc_spoolss_init(NULL))) {
1127 svcctl_cb.init = svcctl_init_cb;
1128 svcctl_cb.shutdown = svcctl_shutdown_cb;
1129 svcctl_cb.private_data = ep_ctx;
1130 if (!NT_STATUS_IS_OK(rpc_svcctl_init(&svcctl_cb))) {
1134 ntsvcs_cb.init = ntsvcs_init_cb;
1135 ntsvcs_cb.shutdown = NULL;
1136 ntsvcs_cb.private_data = ep_ctx;
1137 if (!NT_STATUS_IS_OK(rpc_ntsvcs_init(&ntsvcs_cb))) {
1141 eventlog_cb.init = eventlog_init_cb;
1142 eventlog_cb.shutdown = NULL;
1143 eventlog_cb.private_data = ep_ctx;
1144 if (!NT_STATUS_IS_OK(rpc_eventlog_init(&eventlog_cb))) {
1148 initshutdown_cb.init = initshutdown_init_cb;
1149 initshutdown_cb.shutdown = NULL;
1150 initshutdown_cb.private_data = ep_ctx;
1151 if (!NT_STATUS_IS_OK(rpc_initshutdown_init(&initshutdown_cb))) {
1155 netdfs_cb.init = netdfs_init_cb;
1156 netdfs_cb.shutdown = NULL;
1157 netdfs_cb.private_data = ep_ctx;
1158 if (!NT_STATUS_IS_OK(rpc_netdfs_init(&netdfs_cb))) {
1163 rpcecho_cb.init = rpcecho_init_cb;
1164 rpcecho_cb.shutdown = NULL;
1165 rpcecho_cb.private_data = ep_ctx;
1166 if (!NT_STATUS_IS_OK(rpc_rpcecho_init(&rpcecho_cb))) {
1171 dssetup_cb.init = dssetup_init_cb;
1172 dssetup_cb.shutdown = NULL;
1173 dssetup_cb.private_data = ep_ctx;
1174 if (!NT_STATUS_IS_OK(rpc_dssetup_init(&dssetup_cb))) {
1178 wkssvc_cb.init = wkssvc_init_cb;
1179 wkssvc_cb.shutdown = NULL;
1180 wkssvc_cb.private_data = ep_ctx;
1181 if (!NT_STATUS_IS_OK(rpc_wkssvc_init(&wkssvc_cb))) {
1188 /* vim: set ts=8 sw=8 noet cindent ft=c.doxygen: */