samba36: reorganize patches, fix windows 7 compatibility
[openwrt/svn-archive/archive.git] / net / samba36 / patches / 250-remove_domain_logon.patch
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
7 +#ifdef NETLOGON_SUPPORT
8 static bool netlogon_init_cb(void *ptr)
9 {
10 struct dcesrv_ep_context *ep_ctx =
11 @@ -654,6 +655,7 @@ static bool netlogon_init_cb(void *ptr)
12
13 return true;
14 }
15 +#endif
16
17 static bool spoolss_init_cb(void *ptr)
18 {
19 @@ -1116,12 +1118,15 @@ bool dcesrv_ep_setup(struct tevent_conte
20 return false;
21 }
22
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))) {
28 return false;
29 }
30 +#endif
31 +
32
33 rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
34 "rpc_server",
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)) {
39 return false;
40 }
41 +#ifdef NETLOGON_SUPPORT
42 if (!smb_register_ndr_interface(&ndr_table_netlogon)) {
43 return false;
44 }
45 +#endif
46 if (!smb_register_ndr_interface(&ndr_table_srvsvc)) {
47 return false;
48 }
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();
53 #endif
54
55 +#ifdef NETLOGON_SUPPORT
56 rpc_netlogon_shutdown();
57 +#endif
58 rpc_samr_shutdown();
59 rpc_lsarpc_shutdown();
60 }
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 )
64 i++;
65 #endif
66
67 +#ifdef NETLOGON_SUPPORT
68 svcctl_ops[i].name = talloc_strdup( svcctl_ops, "NETLOGON" );
69 svcctl_ops[i].ops = &netlogon_svc_ops;
70 i++;
71 +#endif
72
73 #ifdef WINREG_SUPPORT
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_
78 NTSTATUS status;
79 const char *pdc_name;
80
81 +#ifndef NETLOGON_SUPPORT
82 + return;
83 +#endif
84 +
85 in_addr_to_sockaddr_storage(&ss, p->ip);
86 pss = iface_ip((struct sockaddr *)&ss);
87 if (!pss) {
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
92 spoolss_commands,
93 #endif
94 +#ifdef NETLOGON_SUPPORT
95 netlogon_commands,
96 +#endif
97 srvsvc_commands,
98 #ifdef DFS_SUPPORT
99 dfs_commands,
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
103 WERROR werr;
104 struct security_token *token = p->session_info->security_token;
105
106 +#ifndef NETLOGON_SUPPORT
107 + return WERR_NOT_SUPPORTED;
108 +#endif
109 +
110 if (!r->in.domain_name) {
111 return WERR_INVALID_PARAM;
112 }
113 @@ -897,6 +901,10 @@ WERROR _wkssvc_NetrUnjoinDomain2(struct
114 WERROR werr;
115 struct security_token *token = p->session_info->security_token;
116
117 +#ifndef NETLOGON_SUPPORT
118 + return WERR_NOT_SUPPORTED;
119 +#endif
120 +
121 if (!r->in.account || !r->in.encrypted_password) {
122 return WERR_INVALID_PARAM;
123 }