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_internal.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
,
277 &iface
->syntax_id
.uuid
,
281 if (!NT_STATUS_IS_OK(status
)) {
289 * Monitor the connection to the endpoint mapper and if it goes away, try to
290 * register the endpoint.
292 static void rpc_ep_setup_monitor_loop(struct tevent_req
*subreq
)
294 struct rpc_ep_regsiter_state
*state
=
295 tevent_req_callback_data(subreq
, struct rpc_ep_regsiter_state
);
296 struct policy_handle entry_handle
;
297 struct dcerpc_binding map_binding
;
298 struct epm_twr_p_t towers
[10];
299 struct epm_twr_t
*map_tower
;
300 uint32_t num_towers
= 0;
303 uint32_t result
= EPMAPPER_STATUS_CANT_PERFORM_OP
;
308 ZERO_STRUCT(entry_handle
);
310 tmp_ctx
= talloc_stackframe();
311 if (tmp_ctx
== NULL
) {
316 ok
= tevent_wakeup_recv(subreq
);
323 /* Create map tower */
324 map_binding
.transport
= NCACN_NP
;
325 map_binding
.object
= state
->iface
->syntax_id
;
326 map_binding
.host
= "";
327 map_binding
.endpoint
= "";
329 map_tower
= talloc_zero(tmp_ctx
, struct epm_twr_t
);
330 if (map_tower
== NULL
) {
331 talloc_free(tmp_ctx
);
336 status
= dcerpc_binding_build_tower(map_tower
, &map_binding
,
338 if (!NT_STATUS_IS_OK(status
)) {
339 talloc_free(tmp_ctx
);
345 status
= dcerpc_epm_Map(state
->h
,
354 if (NT_STATUS_IS_OK(status
)) {
357 if (result
== EPMAPPER_STATUS_OK
||
358 result
== EPMAPPER_STATUS_NO_MORE_ENTRIES
) {
361 if (num_towers
== 0) {
365 talloc_free(tmp_ctx
);
367 subreq
= tevent_wakeup_send(state
->mem_ctx
,
369 timeval_current_ofs(MONITOR_WAIT_TIME
, 0));
370 if (tevent_req_nomem(state
->mem_ctx
, subreq
)) {
376 tevent_req_set_callback(subreq
, rpc_ep_setup_monitor_loop
, state
);
378 TALLOC_FREE(state
->h
);
379 state
->wait_time
= 1;
381 tevent_req_set_callback(subreq
, rpc_ep_setup_register_loop
, state
);
387 static bool epmapper_init_cb(void *ptr
)
389 struct dcesrv_ep_context
*ep_ctx
=
390 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
393 port
= _open_sockets(ep_ctx
->ev_ctx
,
395 ndr_table_epmapper
.syntax_id
,
404 static bool epmapper_shutdown_cb(void *ptr
)
406 srv_epmapper_cleanup();
411 static bool winreg_init_cb(void *ptr
)
413 struct dcesrv_ep_context
*ep_ctx
=
414 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
415 struct ndr_syntax_id abstract_syntax
= ndr_table_winreg
.syntax_id
;
416 const char *pipe_name
= "winreg";
417 const char *rpcsrv_type
;
420 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
425 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
426 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
430 ok
= setup_dcerpc_ncalrpc_socket(ep_ctx
->ev_ctx
,
437 port
= _open_sockets(ep_ctx
->ev_ctx
,
445 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
450 if (!NT_STATUS_IS_OK(status
)) {
458 static bool srvsvc_init_cb(void *ptr
)
460 struct dcesrv_ep_context
*ep_ctx
=
461 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
462 struct ndr_syntax_id abstract_syntax
= ndr_table_srvsvc
.syntax_id
;
463 const char *pipe_name
= "srvsvc";
464 const char *rpcsrv_type
;
467 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
472 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
473 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
477 ok
= setup_dcerpc_ncalrpc_socket(ep_ctx
->ev_ctx
,
485 port
= _open_sockets(ep_ctx
->ev_ctx
,
493 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
498 if (!NT_STATUS_IS_OK(status
)) {
506 static bool lsarpc_init_cb(void *ptr
)
508 struct dcesrv_ep_context
*ep_ctx
=
509 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
510 struct ndr_syntax_id abstract_syntax
= ndr_table_lsarpc
.syntax_id
;
511 const char *pipe_name
= "lsarpc";
512 const char *rpcsrv_type
;
515 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
520 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
521 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
525 ok
= setup_dcerpc_ncalrpc_socket(ep_ctx
->ev_ctx
,
533 port
= _open_sockets(ep_ctx
->ev_ctx
,
541 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
546 if (!NT_STATUS_IS_OK(status
)) {
554 static bool samr_init_cb(void *ptr
)
556 struct dcesrv_ep_context
*ep_ctx
=
557 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
558 struct ndr_syntax_id abstract_syntax
= ndr_table_samr
.syntax_id
;
559 const char *pipe_name
= "samr";
560 const char *rpcsrv_type
;
563 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
568 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
569 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
573 ok
= setup_dcerpc_ncalrpc_socket(ep_ctx
->ev_ctx
,
581 port
= _open_sockets(ep_ctx
->ev_ctx
,
589 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
594 if (!NT_STATUS_IS_OK(status
)) {
602 static bool netlogon_init_cb(void *ptr
)
604 struct dcesrv_ep_context
*ep_ctx
=
605 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
606 struct ndr_syntax_id abstract_syntax
= ndr_table_netlogon
.syntax_id
;
607 const char *pipe_name
= "netlogon";
608 const char *rpcsrv_type
;
611 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
616 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
617 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
621 ok
= setup_dcerpc_ncalrpc_socket(ep_ctx
->ev_ctx
,
629 port
= _open_sockets(ep_ctx
->ev_ctx
,
637 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
642 if (!NT_STATUS_IS_OK(status
)) {
650 static bool spoolss_init_cb(void *ptr
)
652 struct dcesrv_ep_context
*ep_ctx
=
653 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
654 const char *rpcsrv_type
;
657 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
663 * Migrate the printers first.
665 ok
= nt_printing_tdb_migrate(ep_ctx
->msg_ctx
);
670 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
671 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
674 status
=rpc_ep_setup_register(ep_ctx
->ev_ctx
,
679 if (!NT_STATUS_IS_OK(status
)) {
687 static bool spoolss_shutdown_cb(void *ptr
)
689 srv_spoolss_cleanup();
694 static bool svcctl_init_cb(void *ptr
)
696 struct dcesrv_ep_context
*ep_ctx
=
697 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
698 const char *rpcsrv_type
;
701 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
706 ok
= svcctl_init_winreg(ep_ctx
->msg_ctx
);
711 /* initialize the control hooks */
712 init_service_op_table();
714 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
715 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
718 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
723 if (!NT_STATUS_IS_OK(status
)) {
731 static bool svcctl_shutdown_cb(void *ptr
)
733 shutdown_service_op_table();
738 static bool ntsvcs_init_cb(void *ptr
)
740 struct dcesrv_ep_context
*ep_ctx
=
741 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
742 const char *rpcsrv_type
;
744 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
749 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
750 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
753 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
758 if (!NT_STATUS_IS_OK(status
)) {
766 static bool eventlog_init_cb(void *ptr
)
768 struct dcesrv_ep_context
*ep_ctx
=
769 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
770 const char *rpcsrv_type
;
773 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
778 ok
= eventlog_init_winreg(ep_ctx
->msg_ctx
);
783 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
784 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
787 status
=rpc_ep_setup_register(ep_ctx
->ev_ctx
,
792 if (!NT_STATUS_IS_OK(status
)) {
800 static bool initshutdown_init_cb(void *ptr
)
802 struct dcesrv_ep_context
*ep_ctx
=
803 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
804 const char *rpcsrv_type
;
806 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
811 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
812 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
815 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
817 &ndr_table_initshutdown
,
820 if (!NT_STATUS_IS_OK(status
)) {
829 static bool rpcecho_init_cb(void *ptr
) {
830 struct dcesrv_ep_context
*ep_ctx
=
831 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
832 const char *rpcsrv_type
;
835 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
840 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
841 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
844 port
= _open_sockets(ep_ctx
->ev_ctx
,
846 ndr_table_rpcecho
.syntax_id
,
852 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
857 if (!NT_STATUS_IS_OK(status
)) {
867 static bool netdfs_init_cb(void *ptr
)
869 struct dcesrv_ep_context
*ep_ctx
=
870 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
871 struct ndr_syntax_id abstract_syntax
= ndr_table_netdfs
.syntax_id
;
872 const char *pipe_name
= "netdfs";
873 const char *rpcsrv_type
;
876 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
880 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
881 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
885 ok
= setup_dcerpc_ncalrpc_socket(ep_ctx
->ev_ctx
,
893 port
= _open_sockets(ep_ctx
->ev_ctx
,
901 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
906 if (!NT_STATUS_IS_OK(status
)) {
914 static bool dssetup_init_cb(void *ptr
)
916 struct dcesrv_ep_context
*ep_ctx
=
917 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
918 struct ndr_syntax_id abstract_syntax
= ndr_table_dssetup
.syntax_id
;
919 const char *pipe_name
= "dssetup";
920 const char *rpcsrv_type
;
923 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
928 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
929 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
933 ok
= setup_dcerpc_ncalrpc_socket(ep_ctx
->ev_ctx
,
941 port
= _open_sockets(ep_ctx
->ev_ctx
,
949 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
954 if (!NT_STATUS_IS_OK(status
)) {
962 static bool wkssvc_init_cb(void *ptr
)
964 struct dcesrv_ep_context
*ep_ctx
=
965 talloc_get_type_abort(ptr
, struct dcesrv_ep_context
);
966 struct ndr_syntax_id abstract_syntax
= ndr_table_wkssvc
.syntax_id
;
967 const char *pipe_name
= "wkssvc";
968 const char *rpcsrv_type
;
971 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
975 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0 ||
976 strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
980 ok
= setup_dcerpc_ncalrpc_socket(ep_ctx
->ev_ctx
,
988 port
= _open_sockets(ep_ctx
->ev_ctx
,
996 status
= rpc_ep_setup_register(ep_ctx
->ev_ctx
,
1001 if (!NT_STATUS_IS_OK(status
)) {
1009 bool dcesrv_ep_setup(struct tevent_context
*ev_ctx
,
1010 struct messaging_context
*msg_ctx
)
1012 struct dcesrv_ep_context
*ep_ctx
;
1014 struct rpc_srv_callbacks epmapper_cb
;
1016 struct rpc_srv_callbacks winreg_cb
;
1017 struct rpc_srv_callbacks srvsvc_cb
;
1019 struct rpc_srv_callbacks lsarpc_cb
;
1020 struct rpc_srv_callbacks samr_cb
;
1021 struct rpc_srv_callbacks netlogon_cb
;
1023 struct rpc_srv_callbacks spoolss_cb
;
1024 struct rpc_srv_callbacks svcctl_cb
;
1025 struct rpc_srv_callbacks ntsvcs_cb
;
1026 struct rpc_srv_callbacks eventlog_cb
;
1027 struct rpc_srv_callbacks initshutdown_cb
;
1028 struct rpc_srv_callbacks netdfs_cb
;
1030 struct rpc_srv_callbacks rpcecho_cb
;
1032 struct rpc_srv_callbacks dssetup_cb
;
1033 struct rpc_srv_callbacks wkssvc_cb
;
1035 const char *rpcsrv_type
;
1037 ep_ctx
= talloc(ev_ctx
, struct dcesrv_ep_context
);
1038 if (ep_ctx
== NULL
) {
1042 ep_ctx
->ev_ctx
= ev_ctx
;
1043 ep_ctx
->msg_ctx
= msg_ctx
;
1045 /* start endpoint mapper only if enabled */
1046 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
1050 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0) {
1051 epmapper_cb
.init
= epmapper_init_cb
;
1052 epmapper_cb
.shutdown
= epmapper_shutdown_cb
;
1053 epmapper_cb
.private_data
= ep_ctx
;
1055 if (!NT_STATUS_IS_OK(rpc_epmapper_init(&epmapper_cb
))) {
1058 } else if (strcasecmp_m(rpcsrv_type
, "daemon") == 0) {
1059 if (!NT_STATUS_IS_OK(rpc_epmapper_init(NULL
))) {
1064 winreg_cb
.init
= winreg_init_cb
;
1065 winreg_cb
.shutdown
= NULL
;
1066 winreg_cb
.private_data
= ep_ctx
;
1067 if (!NT_STATUS_IS_OK(rpc_winreg_init(&winreg_cb
))) {
1071 srvsvc_cb
.init
= srvsvc_init_cb
;
1072 srvsvc_cb
.shutdown
= NULL
;
1073 srvsvc_cb
.private_data
= ep_ctx
;
1074 if (!NT_STATUS_IS_OK(rpc_srvsvc_init(&srvsvc_cb
))) {
1079 lsarpc_cb
.init
= lsarpc_init_cb
;
1080 lsarpc_cb
.shutdown
= NULL
;
1081 lsarpc_cb
.private_data
= ep_ctx
;
1082 if (!NT_STATUS_IS_OK(rpc_lsarpc_init(&lsarpc_cb
))) {
1086 samr_cb
.init
= samr_init_cb
;
1087 samr_cb
.shutdown
= NULL
;
1088 samr_cb
.private_data
= ep_ctx
;
1089 if (!NT_STATUS_IS_OK(rpc_samr_init(&samr_cb
))) {
1093 netlogon_cb
.init
= netlogon_init_cb
;
1094 netlogon_cb
.shutdown
= NULL
;
1095 netlogon_cb
.private_data
= ep_ctx
;
1096 if (!NT_STATUS_IS_OK(rpc_netlogon_init(&netlogon_cb
))) {
1100 rpcsrv_type
= lp_parm_const_string(GLOBAL_SECTION_SNUM
,
1104 if (strcasecmp_m(rpcsrv_type
, "embedded") == 0) {
1105 spoolss_cb
.init
= spoolss_init_cb
;
1106 spoolss_cb
.shutdown
= spoolss_shutdown_cb
;
1107 spoolss_cb
.private_data
= ep_ctx
;
1108 if (!NT_STATUS_IS_OK(rpc_spoolss_init(&spoolss_cb
))) {
1111 } else if (strcasecmp_m(rpcsrv_type
, "daemon") == 0 ||
1112 strcasecmp_m(rpcsrv_type
, "external") == 0) {
1113 if (!NT_STATUS_IS_OK(rpc_spoolss_init(NULL
))) {
1118 svcctl_cb
.init
= svcctl_init_cb
;
1119 svcctl_cb
.shutdown
= svcctl_shutdown_cb
;
1120 svcctl_cb
.private_data
= ep_ctx
;
1121 if (!NT_STATUS_IS_OK(rpc_svcctl_init(&svcctl_cb
))) {
1125 ntsvcs_cb
.init
= ntsvcs_init_cb
;
1126 ntsvcs_cb
.shutdown
= NULL
;
1127 ntsvcs_cb
.private_data
= ep_ctx
;
1128 if (!NT_STATUS_IS_OK(rpc_ntsvcs_init(&ntsvcs_cb
))) {
1132 eventlog_cb
.init
= eventlog_init_cb
;
1133 eventlog_cb
.shutdown
= NULL
;
1134 eventlog_cb
.private_data
= ep_ctx
;
1135 if (!NT_STATUS_IS_OK(rpc_eventlog_init(&eventlog_cb
))) {
1139 initshutdown_cb
.init
= initshutdown_init_cb
;
1140 initshutdown_cb
.shutdown
= NULL
;
1141 initshutdown_cb
.private_data
= ep_ctx
;
1142 if (!NT_STATUS_IS_OK(rpc_initshutdown_init(&initshutdown_cb
))) {
1146 netdfs_cb
.init
= netdfs_init_cb
;
1147 netdfs_cb
.shutdown
= NULL
;
1148 netdfs_cb
.private_data
= ep_ctx
;
1149 if (!NT_STATUS_IS_OK(rpc_netdfs_init(&netdfs_cb
))) {
1154 rpcecho_cb
.init
= rpcecho_init_cb
;
1155 rpcecho_cb
.shutdown
= NULL
;
1156 rpcecho_cb
.private_data
= ep_ctx
;
1157 if (!NT_STATUS_IS_OK(rpc_rpcecho_init(&rpcecho_cb
))) {
1162 dssetup_cb
.init
= dssetup_init_cb
;
1163 dssetup_cb
.shutdown
= NULL
;
1164 dssetup_cb
.private_data
= ep_ctx
;
1165 if (!NT_STATUS_IS_OK(rpc_dssetup_init(&dssetup_cb
))) {
1169 wkssvc_cb
.init
= wkssvc_init_cb
;
1170 wkssvc_cb
.shutdown
= NULL
;
1171 wkssvc_cb
.private_data
= ep_ctx
;
1172 if (!NT_STATUS_IS_OK(rpc_wkssvc_init(&wkssvc_cb
))) {
1179 /* vim: set ts=8 sw=8 noet cindent ft=c.doxygen: */