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,
90 const char *sock_addr = lp_socket_address();
94 if (strequal(sock_addr, "0.0.0.0") ||
95 strequal(sock_addr, "::")) {
97 sock_addr = "::,0.0.0.0";
99 sock_addr = "0.0.0.0";
103 for (sock_ptr = sock_addr;
104 next_token_talloc(talloc_tos(), &sock_ptr, &sock_tok, " \t,");
106 struct sockaddr_storage ss;
108 /* open an incoming socket */
109 if (!interpret_string_addr(&ss,
111 AI_NUMERICHOST|AI_PASSIVE)) {
115 p = setup_dcerpc_ncacn_tcpip_socket(ev_ctx,
129 static void rpc_ep_setup_register_loop(struct tevent_req *subreq);
130 static NTSTATUS rpc_ep_setup_try_register(TALLOC_CTX *mem_ctx,
131 struct tevent_context *ev_ctx,
132 struct messaging_context *msg_ctx,
133 const struct ndr_interface_table *iface,
136 struct dcerpc_binding_handle **pbh);
138 struct rpc_ep_regsiter_state {
139 struct dcerpc_binding_handle *h;
142 struct tevent_context *ev_ctx;
143 struct messaging_context *msg_ctx;
145 const struct ndr_interface_table *iface;
153 NTSTATUS rpc_ep_setup_register(struct tevent_context *ev_ctx,
154 struct messaging_context *msg_ctx,
155 const struct ndr_interface_table *iface,
159 struct rpc_ep_regsiter_state *state;
160 struct tevent_req *req;
162 state = talloc(ev_ctx, struct rpc_ep_regsiter_state);
164 return NT_STATUS_NO_MEMORY;
167 state->mem_ctx = talloc_named(state,
171 if (state->mem_ctx == NULL) {
173 return NT_STATUS_NO_MEMORY;
176 state->wait_time = 1;
177 state->ev_ctx = ev_ctx;
178 state->msg_ctx = msg_ctx;
179 state->iface = iface;
180 state->ncalrpc = talloc_strdup(state, ncalrpc);
183 req = tevent_wakeup_send(state->mem_ctx,
185 timeval_current_ofs(1, 0));
186 if (tevent_req_nomem(state->mem_ctx, req)) {
188 return NT_STATUS_NO_MEMORY;
191 tevent_req_set_callback(req, rpc_ep_setup_register_loop, state);
196 #define MONITOR_WAIT_TIME 15
197 static void rpc_ep_setup_monitor_loop(struct tevent_req *subreq);
199 static void rpc_ep_setup_register_loop(struct tevent_req *subreq)
201 struct rpc_ep_regsiter_state *state =
202 tevent_req_callback_data(subreq, struct rpc_ep_regsiter_state);
206 ok = tevent_wakeup_recv(subreq);
213 status = rpc_ep_setup_try_register(state->mem_ctx,
220 if (NT_STATUS_IS_OK(status)) {
221 /* endpoint registered, monitor the connnection. */
222 subreq = tevent_wakeup_send(state->mem_ctx,
224 timeval_current_ofs(MONITOR_WAIT_TIME, 0));
225 if (tevent_req_nomem(state->mem_ctx, subreq)) {
230 tevent_req_set_callback(subreq, rpc_ep_setup_monitor_loop, state);
234 state->wait_time = state->wait_time * 2;
235 if (state->wait_time > 16) {
236 DEBUG(0, ("Failed to register endpoint '%s'!\n",
237 state->iface->name));
238 state->wait_time = 16;
241 subreq = tevent_wakeup_send(state->mem_ctx,
243 timeval_current_ofs(state->wait_time, 0));
244 if (tevent_req_nomem(state->mem_ctx, subreq)) {
249 tevent_req_set_callback(subreq, rpc_ep_setup_register_loop, state);
253 static NTSTATUS rpc_ep_setup_try_register(TALLOC_CTX *mem_ctx,
254 struct tevent_context *ev_ctx,
255 struct messaging_context *msg_ctx,
256 const struct ndr_interface_table *iface,
259 struct dcerpc_binding_handle **pbh)
261 struct dcerpc_binding_vector *v = NULL;
264 status = dcerpc_binding_vector_create(mem_ctx,
269 if (!NT_STATUS_IS_OK(status)) {
273 status = dcerpc_ep_register(mem_ctx,
276 &iface->syntax_id.uuid,
280 if (!NT_STATUS_IS_OK(status)) {
288 * Monitor the connection to the endpoint mapper and if it goes away, try to
289 * register the endpoint.
291 static void rpc_ep_setup_monitor_loop(struct tevent_req *subreq)
293 struct rpc_ep_regsiter_state *state =
294 tevent_req_callback_data(subreq, struct rpc_ep_regsiter_state);
295 struct policy_handle entry_handle;
296 struct dcerpc_binding map_binding;
297 struct epm_twr_p_t towers[10];
298 struct epm_twr_t *map_tower;
299 uint32_t num_towers = 0;
302 uint32_t result = EPMAPPER_STATUS_CANT_PERFORM_OP;
307 ZERO_STRUCT(entry_handle);
309 tmp_ctx = talloc_stackframe();
310 if (tmp_ctx == NULL) {
315 ok = tevent_wakeup_recv(subreq);
322 /* Create map tower */
323 map_binding.transport = NCACN_NP;
324 map_binding.object = state->iface->syntax_id;
325 map_binding.host = "";
326 map_binding.endpoint = "";
328 map_tower = talloc_zero(tmp_ctx, struct epm_twr_t);
329 if (map_tower == NULL) {
330 talloc_free(tmp_ctx);
335 status = dcerpc_binding_build_tower(map_tower, &map_binding,
337 if (!NT_STATUS_IS_OK(status)) {
338 talloc_free(tmp_ctx);
344 status = dcerpc_epm_Map(state->h,
353 if (NT_STATUS_IS_OK(status)) {
356 if (result == EPMAPPER_STATUS_OK ||
357 result == EPMAPPER_STATUS_NO_MORE_ENTRIES) {
360 if (num_towers == 0) {
364 talloc_free(tmp_ctx);
366 subreq = tevent_wakeup_send(state->mem_ctx,
368 timeval_current_ofs(MONITOR_WAIT_TIME, 0));
369 if (tevent_req_nomem(state->mem_ctx, subreq)) {
375 tevent_req_set_callback(subreq, rpc_ep_setup_monitor_loop, state);
377 TALLOC_FREE(state->h);
378 state->wait_time = 1;
380 tevent_req_set_callback(subreq, rpc_ep_setup_register_loop, state);
386 static bool epmapper_init_cb(void *ptr)
388 struct dcesrv_ep_context *ep_ctx =
389 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
392 port = _open_sockets(ep_ctx->ev_ctx,
394 ndr_table_epmapper.syntax_id,
403 static bool epmapper_shutdown_cb(void *ptr)
405 srv_epmapper_cleanup();
410 static bool winreg_init_cb(void *ptr)
412 struct dcesrv_ep_context *ep_ctx =
413 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
414 struct ndr_syntax_id abstract_syntax = ndr_table_winreg.syntax_id;
415 const char *pipe_name = "winreg";
416 const char *rpcsrv_type;
419 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
424 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
425 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
429 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
436 port = _open_sockets(ep_ctx->ev_ctx,
444 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
449 if (!NT_STATUS_IS_OK(status)) {
457 static bool srvsvc_init_cb(void *ptr)
459 struct dcesrv_ep_context *ep_ctx =
460 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
461 struct ndr_syntax_id abstract_syntax = ndr_table_srvsvc.syntax_id;
462 const char *pipe_name = "srvsvc";
463 const char *rpcsrv_type;
466 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
471 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
472 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
476 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
484 port = _open_sockets(ep_ctx->ev_ctx,
492 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
497 if (!NT_STATUS_IS_OK(status)) {
505 static bool lsarpc_init_cb(void *ptr)
507 struct dcesrv_ep_context *ep_ctx =
508 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
509 struct ndr_syntax_id abstract_syntax = ndr_table_lsarpc.syntax_id;
510 const char *pipe_name = "lsarpc";
511 const char *rpcsrv_type;
514 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
519 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
520 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
524 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
532 port = _open_sockets(ep_ctx->ev_ctx,
540 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
545 if (!NT_STATUS_IS_OK(status)) {
553 static bool samr_init_cb(void *ptr)
555 struct dcesrv_ep_context *ep_ctx =
556 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
557 struct ndr_syntax_id abstract_syntax = ndr_table_samr.syntax_id;
558 const char *pipe_name = "samr";
559 const char *rpcsrv_type;
562 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
567 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
568 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
572 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
580 port = _open_sockets(ep_ctx->ev_ctx,
588 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
593 if (!NT_STATUS_IS_OK(status)) {
601 static bool netlogon_init_cb(void *ptr)
603 struct dcesrv_ep_context *ep_ctx =
604 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
605 struct ndr_syntax_id abstract_syntax = ndr_table_netlogon.syntax_id;
606 const char *pipe_name = "netlogon";
607 const char *rpcsrv_type;
610 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
615 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
616 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
620 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
628 port = _open_sockets(ep_ctx->ev_ctx,
636 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
641 if (!NT_STATUS_IS_OK(status)) {
649 static bool spoolss_init_cb(void *ptr)
651 struct dcesrv_ep_context *ep_ctx =
652 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
653 const char *rpcsrv_type;
656 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
662 * Migrate the printers first.
664 ok = nt_printing_tdb_migrate(ep_ctx->msg_ctx);
669 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
670 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
673 status =rpc_ep_setup_register(ep_ctx->ev_ctx,
678 if (!NT_STATUS_IS_OK(status)) {
686 static bool spoolss_shutdown_cb(void *ptr)
688 srv_spoolss_cleanup();
693 static bool svcctl_init_cb(void *ptr)
695 struct dcesrv_ep_context *ep_ctx =
696 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
697 const char *rpcsrv_type;
700 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
705 ok = svcctl_init_winreg(ep_ctx->msg_ctx);
710 /* initialize the control hooks */
711 init_service_op_table();
713 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
714 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
717 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
722 if (!NT_STATUS_IS_OK(status)) {
730 static bool svcctl_shutdown_cb(void *ptr)
732 shutdown_service_op_table();
737 static bool ntsvcs_init_cb(void *ptr)
739 struct dcesrv_ep_context *ep_ctx =
740 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
741 const char *rpcsrv_type;
743 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
748 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
749 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
752 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
757 if (!NT_STATUS_IS_OK(status)) {
765 static bool eventlog_init_cb(void *ptr)
767 struct dcesrv_ep_context *ep_ctx =
768 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
769 const char *rpcsrv_type;
772 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
777 ok = eventlog_init_winreg(ep_ctx->msg_ctx);
782 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
783 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
786 status =rpc_ep_setup_register(ep_ctx->ev_ctx,
791 if (!NT_STATUS_IS_OK(status)) {
799 static bool initshutdown_init_cb(void *ptr)
801 struct dcesrv_ep_context *ep_ctx =
802 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
803 const char *rpcsrv_type;
805 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
810 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
811 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
814 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
816 &ndr_table_initshutdown,
819 if (!NT_STATUS_IS_OK(status)) {
828 static bool rpcecho_init_cb(void *ptr) {
829 struct dcesrv_ep_context *ep_ctx =
830 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
831 const char *rpcsrv_type;
834 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
839 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
840 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
843 port = _open_sockets(ep_ctx->ev_ctx,
845 ndr_table_rpcecho.syntax_id,
851 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
856 if (!NT_STATUS_IS_OK(status)) {
866 static bool netdfs_init_cb(void *ptr)
868 struct dcesrv_ep_context *ep_ctx =
869 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
870 struct ndr_syntax_id abstract_syntax = ndr_table_netdfs.syntax_id;
871 const char *pipe_name = "netdfs";
872 const char *rpcsrv_type;
875 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
879 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
880 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
884 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
892 port = _open_sockets(ep_ctx->ev_ctx,
900 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
905 if (!NT_STATUS_IS_OK(status)) {
913 static bool dssetup_init_cb(void *ptr)
915 struct dcesrv_ep_context *ep_ctx =
916 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
917 struct ndr_syntax_id abstract_syntax = ndr_table_dssetup.syntax_id;
918 const char *pipe_name = "dssetup";
919 const char *rpcsrv_type;
922 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
927 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
928 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
932 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
940 port = _open_sockets(ep_ctx->ev_ctx,
948 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
953 if (!NT_STATUS_IS_OK(status)) {
961 static bool wkssvc_init_cb(void *ptr)
963 struct dcesrv_ep_context *ep_ctx =
964 talloc_get_type_abort(ptr, struct dcesrv_ep_context);
965 struct ndr_syntax_id abstract_syntax = ndr_table_wkssvc.syntax_id;
966 const char *pipe_name = "wkssvc";
967 const char *rpcsrv_type;
970 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
974 if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
975 strcasecmp_m(rpcsrv_type, "daemon") == 0) {
979 ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
987 port = _open_sockets(ep_ctx->ev_ctx,
995 status = rpc_ep_setup_register(ep_ctx->ev_ctx,
1000 if (!NT_STATUS_IS_OK(status)) {
1008 bool dcesrv_ep_setup(struct tevent_context *ev_ctx,
1009 struct messaging_context *msg_ctx)
1011 struct dcesrv_ep_context *ep_ctx;
1013 struct rpc_srv_callbacks epmapper_cb;
1015 struct rpc_srv_callbacks winreg_cb;
1016 struct rpc_srv_callbacks srvsvc_cb;
1018 struct rpc_srv_callbacks lsarpc_cb;
1019 struct rpc_srv_callbacks samr_cb;
1020 struct rpc_srv_callbacks netlogon_cb;
1022 struct rpc_srv_callbacks spoolss_cb;
1023 struct rpc_srv_callbacks svcctl_cb;
1024 struct rpc_srv_callbacks ntsvcs_cb;
1025 struct rpc_srv_callbacks eventlog_cb;
1026 struct rpc_srv_callbacks initshutdown_cb;
1027 struct rpc_srv_callbacks netdfs_cb;
1029 struct rpc_srv_callbacks rpcecho_cb;
1031 struct rpc_srv_callbacks dssetup_cb;
1032 struct rpc_srv_callbacks wkssvc_cb;
1034 const char *rpcsrv_type;
1036 ep_ctx = talloc(ev_ctx, struct dcesrv_ep_context);
1037 if (ep_ctx == NULL) {
1041 ep_ctx->ev_ctx = ev_ctx;
1042 ep_ctx->msg_ctx = msg_ctx;
1044 /* start endpoint mapper only if enabled */
1045 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
1049 if (strcasecmp_m(rpcsrv_type, "embedded") == 0) {
1050 epmapper_cb.init = epmapper_init_cb;
1051 epmapper_cb.shutdown = epmapper_shutdown_cb;
1052 epmapper_cb.private_data = ep_ctx;
1054 if (!NT_STATUS_IS_OK(rpc_epmapper_init(&epmapper_cb))) {
1057 } else if (strcasecmp_m(rpcsrv_type, "daemon") == 0) {
1058 if (!NT_STATUS_IS_OK(rpc_epmapper_init(NULL))) {
1063 winreg_cb.init = winreg_init_cb;
1064 winreg_cb.shutdown = NULL;
1065 winreg_cb.private_data = ep_ctx;
1066 if (!NT_STATUS_IS_OK(rpc_winreg_init(&winreg_cb))) {
1070 srvsvc_cb.init = srvsvc_init_cb;
1071 srvsvc_cb.shutdown = NULL;
1072 srvsvc_cb.private_data = ep_ctx;
1073 if (!NT_STATUS_IS_OK(rpc_srvsvc_init(&srvsvc_cb))) {
1078 lsarpc_cb.init = lsarpc_init_cb;
1079 lsarpc_cb.shutdown = NULL;
1080 lsarpc_cb.private_data = ep_ctx;
1081 if (!NT_STATUS_IS_OK(rpc_lsarpc_init(&lsarpc_cb))) {
1085 samr_cb.init = samr_init_cb;
1086 samr_cb.shutdown = NULL;
1087 samr_cb.private_data = ep_ctx;
1088 if (!NT_STATUS_IS_OK(rpc_samr_init(&samr_cb))) {
1092 netlogon_cb.init = netlogon_init_cb;
1093 netlogon_cb.shutdown = NULL;
1094 netlogon_cb.private_data = ep_ctx;
1095 if (!NT_STATUS_IS_OK(rpc_netlogon_init(&netlogon_cb))) {
1099 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
1103 if (strcasecmp_m(rpcsrv_type, "embedded") == 0) {
1104 spoolss_cb.init = spoolss_init_cb;
1105 spoolss_cb.shutdown = spoolss_shutdown_cb;
1106 spoolss_cb.private_data = ep_ctx;
1107 if (!NT_STATUS_IS_OK(rpc_spoolss_init(&spoolss_cb))) {
1110 } else if (strcasecmp_m(rpcsrv_type, "daemon") == 0 ||
1111 strcasecmp_m(rpcsrv_type, "external") == 0) {
1112 if (!NT_STATUS_IS_OK(rpc_spoolss_init(NULL))) {
1117 svcctl_cb.init = svcctl_init_cb;
1118 svcctl_cb.shutdown = svcctl_shutdown_cb;
1119 svcctl_cb.private_data = ep_ctx;
1120 if (!NT_STATUS_IS_OK(rpc_svcctl_init(&svcctl_cb))) {
1124 ntsvcs_cb.init = ntsvcs_init_cb;
1125 ntsvcs_cb.shutdown = NULL;
1126 ntsvcs_cb.private_data = ep_ctx;
1127 if (!NT_STATUS_IS_OK(rpc_ntsvcs_init(&ntsvcs_cb))) {
1131 eventlog_cb.init = eventlog_init_cb;
1132 eventlog_cb.shutdown = NULL;
1133 eventlog_cb.private_data = ep_ctx;
1134 if (!NT_STATUS_IS_OK(rpc_eventlog_init(&eventlog_cb))) {
1138 initshutdown_cb.init = initshutdown_init_cb;
1139 initshutdown_cb.shutdown = NULL;
1140 initshutdown_cb.private_data = ep_ctx;
1141 if (!NT_STATUS_IS_OK(rpc_initshutdown_init(&initshutdown_cb))) {
1145 netdfs_cb.init = netdfs_init_cb;
1146 netdfs_cb.shutdown = NULL;
1147 netdfs_cb.private_data = ep_ctx;
1148 if (!NT_STATUS_IS_OK(rpc_netdfs_init(&netdfs_cb))) {
1153 rpcecho_cb.init = rpcecho_init_cb;
1154 rpcecho_cb.shutdown = NULL;
1155 rpcecho_cb.private_data = ep_ctx;
1156 if (!NT_STATUS_IS_OK(rpc_rpcecho_init(&rpcecho_cb))) {
1161 dssetup_cb.init = dssetup_init_cb;
1162 dssetup_cb.shutdown = NULL;
1163 dssetup_cb.private_data = ep_ctx;
1164 if (!NT_STATUS_IS_OK(rpc_dssetup_init(&dssetup_cb))) {
1168 wkssvc_cb.init = wkssvc_init_cb;
1169 wkssvc_cb.shutdown = NULL;
1170 wkssvc_cb.private_data = ep_ctx;
1171 if (!NT_STATUS_IS_OK(rpc_wkssvc_init(&wkssvc_cb))) {
1178 /* vim: set ts=8 sw=8 noet cindent ft=c.doxygen: */