1
0

250-remove_domain_logon.patch 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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)
  4. return true;
  5. }
  6. +#ifdef NETLOGON_SUPPORT
  7. static bool netlogon_init_cb(void *ptr)
  8. {
  9. struct dcesrv_ep_context *ep_ctx =
  10. @@ -654,6 +655,7 @@ static bool netlogon_init_cb(void *ptr)
  11. return true;
  12. }
  13. +#endif
  14. static bool spoolss_init_cb(void *ptr)
  15. {
  16. @@ -1116,12 +1118,15 @@ bool dcesrv_ep_setup(struct tevent_conte
  17. return false;
  18. }
  19. +#ifdef NETLOGON_SUPPORT
  20. netlogon_cb.init = netlogon_init_cb;
  21. netlogon_cb.shutdown = NULL;
  22. netlogon_cb.private_data = ep_ctx;
  23. if (!NT_STATUS_IS_OK(rpc_netlogon_init(&netlogon_cb))) {
  24. return false;
  25. }
  26. +#endif
  27. +
  28. rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
  29. "rpc_server",
  30. --- a/source3/librpc/rpc/rpc_common.c
  31. +++ b/source3/librpc/rpc/rpc_common.c
  32. @@ -103,9 +103,11 @@ static bool initialize_interfaces(void)
  33. if (!smb_register_ndr_interface(&ndr_table_samr)) {
  34. return false;
  35. }
  36. +#ifdef NETLOGON_SUPPORT
  37. if (!smb_register_ndr_interface(&ndr_table_netlogon)) {
  38. return false;
  39. }
  40. +#endif
  41. if (!smb_register_ndr_interface(&ndr_table_srvsvc)) {
  42. return false;
  43. }
  44. --- a/source3/smbd/server_exit.c
  45. +++ b/source3/smbd/server_exit.c
  46. @@ -156,7 +156,9 @@ static void exit_server_common(enum serv
  47. rpc_winreg_shutdown();
  48. #endif
  49. +#ifdef NETLOGON_SUPPORT
  50. rpc_netlogon_shutdown();
  51. +#endif
  52. rpc_samr_shutdown();
  53. rpc_lsarpc_shutdown();
  54. }
  55. --- a/source3/rpc_server/svcctl/srv_svcctl_nt.c
  56. +++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c
  57. @@ -91,9 +91,11 @@ bool init_service_op_table( void )
  58. i++;
  59. #endif
  60. +#ifdef NETLOGON_SUPPORT
  61. svcctl_ops[i].name = talloc_strdup( svcctl_ops, "NETLOGON" );
  62. svcctl_ops[i].ops = &netlogon_svc_ops;
  63. i++;
  64. +#endif
  65. #ifdef WINREG_SUPPORT
  66. svcctl_ops[i].name = talloc_strdup( svcctl_ops, "RemoteRegistry" );
  67. --- a/source3/nmbd/nmbd_processlogon.c
  68. +++ b/source3/nmbd/nmbd_processlogon.c
  69. @@ -320,6 +320,10 @@ void process_logon_packet(struct packet_
  70. NTSTATUS status;
  71. const char *pdc_name;
  72. +#ifndef NETLOGON_SUPPORT
  73. + return;
  74. +#endif
  75. +
  76. in_addr_to_sockaddr_storage(&ss, p->ip);
  77. pss = iface_ip((struct sockaddr *)&ss);
  78. if (!pss) {
  79. --- a/source3/rpcclient/rpcclient.c
  80. +++ b/source3/rpcclient/rpcclient.c
  81. @@ -627,7 +627,9 @@ static struct cmd_set *rpcclient_command
  82. #ifdef PRINTER_SUPPORT
  83. spoolss_commands,
  84. #endif
  85. +#ifdef NETLOGON_SUPPORT
  86. netlogon_commands,
  87. +#endif
  88. srvsvc_commands,
  89. #ifdef DFS_SUPPORT
  90. dfs_commands,
  91. --- a/source3/rpc_server/wkssvc/srv_wkssvc_nt.c
  92. +++ b/source3/rpc_server/wkssvc/srv_wkssvc_nt.c
  93. @@ -824,6 +824,10 @@ WERROR _wkssvc_NetrJoinDomain2(struct pi
  94. WERROR werr;
  95. struct security_token *token = p->session_info->security_token;
  96. +#ifndef NETLOGON_SUPPORT
  97. + return WERR_NOT_SUPPORTED;
  98. +#endif
  99. +
  100. if (!r->in.domain_name) {
  101. return WERR_INVALID_PARAM;
  102. }
  103. @@ -901,6 +905,10 @@ WERROR _wkssvc_NetrUnjoinDomain2(struct
  104. WERROR werr;
  105. struct security_token *token = p->session_info->security_token;
  106. +#ifndef NETLOGON_SUPPORT
  107. + return WERR_NOT_SUPPORTED;
  108. +#endif
  109. +
  110. if (!r->in.account || !r->in.encrypted_password) {
  111. return WERR_INVALID_PARAM;
  112. }
  113. --- a/source3/libsmb/trusts_util.c
  114. +++ b/source3/libsmb/trusts_util.c
  115. @@ -46,9 +46,11 @@ NTSTATUS trust_pw_change_and_store_it(st
  116. NTSTATUS nt_status;
  117. switch (sec_channel_type) {
  118. +#ifdef NETLOGON_SUPPORT
  119. case SEC_CHAN_WKSTA:
  120. case SEC_CHAN_DOMAIN:
  121. break;
  122. +#endif
  123. default:
  124. return NT_STATUS_NOT_SUPPORTED;
  125. }
  126. @@ -159,6 +161,11 @@ bool enumerate_domain_trusts( TALLOC_CTX
  127. *num_domains = 0;
  128. *sids = NULL;
  129. +#ifndef NETLOGON_SUPPORT
  130. + return False;
  131. +#endif
  132. +
  133. +
  134. /* lookup a DC first */
  135. if ( !get_dc_name(domain, NULL, dc_name, &dc_ss) ) {
  136. @@ -243,6 +250,10 @@ NTSTATUS change_trust_account_password(
  137. struct cli_state *cli = NULL;
  138. struct rpc_pipe_client *netlogon_pipe = NULL;
  139. +#ifndef NETLOGON_SUPPORT
  140. + return NT_STATUS_UNSUCCESSFUL;
  141. +#endif
  142. +
  143. DEBUG(5,("change_trust_account_password: Attempting to change trust account password in domain %s....\n",
  144. domain));
  145. --- a/source3/auth/auth_domain.c
  146. +++ b/source3/auth/auth_domain.c
  147. @@ -538,7 +538,9 @@ static NTSTATUS auth_init_trustdomain(st
  148. NTSTATUS auth_domain_init(void)
  149. {
  150. +#ifdef NETLOGON_SUPPORT
  151. smb_register_auth(AUTH_INTERFACE_VERSION, "trustdomain", auth_init_trustdomain);
  152. smb_register_auth(AUTH_INTERFACE_VERSION, "ntdomain", auth_init_ntdomain);
  153. +#endif
  154. return NT_STATUS_OK;
  155. }
  156. --- a/source3/smbd/process.c
  157. +++ b/source3/smbd/process.c
  158. @@ -2431,8 +2431,10 @@ static bool housekeeping_fn(const struct
  159. /* check if we need to reload services */
  160. check_reload(sconn, time_mono(NULL));
  161. +#ifdef NETLOGON_SUPPORT
  162. /* Change machine password if neccessary. */
  163. attempt_machine_password_change();
  164. +#endif
  165. /*
  166. * Force a log file check.
  167. --- a/source3/rpc_server/srv_pipe.c
  168. +++ b/source3/rpc_server/srv_pipe.c
  169. @@ -421,10 +421,12 @@ static bool check_bind_req(struct pipes_
  170. if (ok) {
  171. context_fns->allow_connect = false;
  172. }
  173. +#ifdef NETLOGON_SUPPORT
  174. ok = ndr_syntax_id_equal(abstract, &ndr_table_netlogon.syntax_id);
  175. if (ok) {
  176. context_fns->allow_connect = false;
  177. }
  178. +#endif
  179. /*
  180. * for the epmapper and echo interfaces we allow "connect"
  181. * auth_level by default.
  182. --- a/source3/rpc_client/cli_pipe.c
  183. +++ b/source3/rpc_client/cli_pipe.c
  184. @@ -2221,6 +2221,10 @@ static void rpc_pipe_bind_step_two_trigg
  185. struct schannel_state);
  186. struct tevent_req *subreq;
  187. +#ifndef NETLOGON_SUPPORT
  188. + tevent_req_nterror(req, NT_STATUS_UNSUCCESSFUL);
  189. + return;
  190. +#endif
  191. if (schannel_auth == NULL ||
  192. !ndr_syntax_id_equal(&state->cli->abstract_syntax,
  193. &ndr_table_netlogon.syntax_id)) {