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 @@ -156,7 +156,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 @@ -824,6 +824,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 @@ -901,6 +905,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;
124 --- a/source3/libsmb/trusts_util.c
125 +++ b/source3/libsmb/trusts_util.c
126 @@ -46,9 +46,11 @@ NTSTATUS trust_pw_change_and_store_it(st
129 switch (sec_channel_type) {
130 +#ifdef NETLOGON_SUPPORT
132 case SEC_CHAN_DOMAIN:
136 return NT_STATUS_NOT_SUPPORTED;
138 @@ -159,6 +161,11 @@ bool enumerate_domain_trusts( TALLOC_CTX
142 +#ifndef NETLOGON_SUPPORT
147 /* lookup a DC first */
149 if ( !get_dc_name(domain, NULL, dc_name, &dc_ss) ) {
150 @@ -243,6 +250,10 @@ NTSTATUS change_trust_account_password(
151 struct cli_state *cli = NULL;
152 struct rpc_pipe_client *netlogon_pipe = NULL;
154 +#ifndef NETLOGON_SUPPORT
155 + return NT_STATUS_UNSUCCESSFUL;
158 DEBUG(5,("change_trust_account_password: Attempting to change trust account password in domain %s....\n",
161 --- a/source3/auth/auth_domain.c
162 +++ b/source3/auth/auth_domain.c
163 @@ -538,7 +538,9 @@ static NTSTATUS auth_init_trustdomain(st
165 NTSTATUS auth_domain_init(void)
167 +#ifdef NETLOGON_SUPPORT
168 smb_register_auth(AUTH_INTERFACE_VERSION, "trustdomain", auth_init_trustdomain);
169 smb_register_auth(AUTH_INTERFACE_VERSION, "ntdomain", auth_init_ntdomain);
173 --- a/source3/smbd/process.c
174 +++ b/source3/smbd/process.c
175 @@ -2431,8 +2431,10 @@ static bool housekeeping_fn(const struct
176 /* check if we need to reload services */
177 check_reload(sconn, time_mono(NULL));
179 +#ifdef NETLOGON_SUPPORT
180 /* Change machine password if neccessary. */
181 attempt_machine_password_change();
185 * Force a log file check.