1 --- a/source3/rpc_server/rpc_ep_setup.c
2 +++ b/source3/rpc_server/rpc_ep_setup.c
3 @@ -606,6 +606,7 @@ static bool samr_init_cb(void *ptr)
7 +#ifdef NETLOGON_SUPPORT
8 static bool netlogon_init_cb(void *ptr)
10 struct dcesrv_ep_context *ep_ctx =
11 @@ -654,6 +655,7 @@ static bool netlogon_init_cb(void *ptr)
17 static bool spoolss_init_cb(void *ptr)
19 @@ -1116,12 +1118,15 @@ bool dcesrv_ep_setup(struct tevent_conte
23 +#ifdef NETLOGON_SUPPORT
24 netlogon_cb.init = netlogon_init_cb;
25 netlogon_cb.shutdown = NULL;
26 netlogon_cb.private_data = ep_ctx;
27 if (!NT_STATUS_IS_OK(rpc_netlogon_init(&netlogon_cb))) {
33 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
35 --- a/source3/librpc/rpc/rpc_common.c
36 +++ b/source3/librpc/rpc/rpc_common.c
37 @@ -103,9 +103,11 @@ static bool initialize_interfaces(void)
38 if (!smb_register_ndr_interface(&ndr_table_samr)) {
41 +#ifdef NETLOGON_SUPPORT
42 if (!smb_register_ndr_interface(&ndr_table_netlogon)) {
46 if (!smb_register_ndr_interface(&ndr_table_srvsvc)) {
49 --- a/source3/smbd/server_exit.c
50 +++ b/source3/smbd/server_exit.c
51 @@ -157,7 +157,9 @@ static void exit_server_common(enum serv
52 rpc_winreg_shutdown();
55 +#ifdef NETLOGON_SUPPORT
56 rpc_netlogon_shutdown();
59 rpc_lsarpc_shutdown();
61 --- a/source3/rpc_server/svcctl/srv_svcctl_nt.c
62 +++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c
63 @@ -91,9 +91,11 @@ bool init_service_op_table( void )
67 +#ifdef NETLOGON_SUPPORT
68 svcctl_ops[i].name = talloc_strdup( svcctl_ops, "NETLOGON" );
69 svcctl_ops[i].ops = &netlogon_svc_ops;
74 svcctl_ops[i].name = talloc_strdup( svcctl_ops, "RemoteRegistry" );
75 --- a/source3/nmbd/nmbd_processlogon.c
76 +++ b/source3/nmbd/nmbd_processlogon.c
77 @@ -320,6 +320,10 @@ void process_logon_packet(struct packet_
81 +#ifndef NETLOGON_SUPPORT
85 in_addr_to_sockaddr_storage(&ss, p->ip);
86 pss = iface_ip((struct sockaddr *)&ss);
88 --- a/source3/rpcclient/rpcclient.c
89 +++ b/source3/rpcclient/rpcclient.c
90 @@ -627,7 +627,9 @@ static struct cmd_set *rpcclient_command
91 #ifdef PRINTER_SUPPORT
94 +#ifdef NETLOGON_SUPPORT
100 --- a/source3/rpc_server/wkssvc/srv_wkssvc_nt.c
101 +++ b/source3/rpc_server/wkssvc/srv_wkssvc_nt.c
102 @@ -820,6 +820,10 @@ WERROR _wkssvc_NetrJoinDomain2(struct pi
104 struct security_token *token = p->session_info->security_token;
106 +#ifndef NETLOGON_SUPPORT
107 + return WERR_NOT_SUPPORTED;
110 if (!r->in.domain_name) {
111 return WERR_INVALID_PARAM;
113 @@ -897,6 +901,10 @@ WERROR _wkssvc_NetrUnjoinDomain2(struct
115 struct security_token *token = p->session_info->security_token;
117 +#ifndef NETLOGON_SUPPORT
118 + return WERR_NOT_SUPPORTED;
121 if (!r->in.account || !r->in.encrypted_password) {
122 return WERR_INVALID_PARAM;