2 * Unix SMB/CIFS implementation.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
19 #include "rpc_worker.h"
20 #include "librpc/gen_ndr/ndr_srvsvc.h"
21 #include "librpc/gen_ndr/ndr_srvsvc_scompat.h"
22 #include "librpc/gen_ndr/ndr_dfs.h"
23 #include "librpc/gen_ndr/ndr_dfs_scompat.h"
24 #include "librpc/gen_ndr/ndr_wkssvc.h"
25 #include "librpc/gen_ndr/ndr_wkssvc_scompat.h"
26 #include "librpc/gen_ndr/ndr_svcctl.h"
27 #include "librpc/gen_ndr/ndr_svcctl_scompat.h"
28 #include "librpc/gen_ndr/ndr_ntsvcs.h"
29 #include "librpc/gen_ndr/ndr_ntsvcs_scompat.h"
30 #include "librpc/gen_ndr/ndr_eventlog.h"
31 #include "librpc/gen_ndr/ndr_eventlog_scompat.h"
32 #include "librpc/gen_ndr/ndr_initshutdown.h"
33 #include "librpc/gen_ndr/ndr_initshutdown_scompat.h"
34 #include "source3/include/secrets.h"
35 #include "locking/share_mode_lock.h"
36 #include "source3/smbd/proto.h"
38 static size_t classic_interfaces(
39 const struct ndr_interface_table
***pifaces
,
42 static const struct ndr_interface_table
*ifaces
[] = {
45 &ndr_table_initshutdown
,
50 * This last item is truncated from the list by the
51 * num_ifaces -= 1 below. Take care when adding new
56 size_t num_ifaces
= ARRAY_SIZE(ifaces
);
58 switch(lp_server_role()) {
59 case ROLE_ACTIVE_DIRECTORY_DC
:
61 * On the AD DC wkssvc is provided by the 'samba'
62 * binary from source4/
75 static NTSTATUS
classic_servers(
76 struct dcesrv_context
*dce_ctx
,
77 const struct dcesrv_endpoint_server
***_ep_servers
,
78 size_t *_num_ep_servers
,
81 static const struct dcesrv_endpoint_server
*ep_servers
[7] = { NULL
};
82 size_t num_servers
= ARRAY_SIZE(ep_servers
);
86 ep_servers
[0] = srvsvc_get_ep_server();
87 ep_servers
[1] = netdfs_get_ep_server();
88 ep_servers
[2] = initshutdown_get_ep_server();
89 ep_servers
[3] = svcctl_get_ep_server();
90 ep_servers
[4] = ntsvcs_get_ep_server();
91 ep_servers
[5] = eventlog_get_ep_server();
92 ep_servers
[6] = wkssvc_get_ep_server();
94 switch(lp_server_role()) {
95 case ROLE_ACTIVE_DIRECTORY_DC
:
97 * On the AD DC wkssvc is provided by the 'samba'
98 * binary from source4/
108 DBG_ERR("secrets_init() failed\n");
114 DBG_ERR("locking_init() failed\n");
118 status
= share_info_db_init();
119 if (!NT_STATUS_IS_OK(status
)) {
120 DBG_ERR("share_info_db_init failed: %s\n", nt_errstr(status
));
124 lp_load_with_shares(get_dyn_CONFIGFILE());
126 mangle_reset_cache();
128 status
= dcesrv_register_default_auth_types_machine_principal(dce_ctx
);
129 if (!NT_STATUS_IS_OK(status
)) {
133 *_ep_servers
= ep_servers
;
134 *_num_ep_servers
= num_servers
;
138 int main(int argc
, const char *argv
[])
140 return rpc_worker_main(