add chaos_calmer branch
[15.05/openwrt.git] / package / network / services / samba36 / patches / 260-remove_samr.patch
1 --- a/source3/rpc_server/rpc_handles.c
2 +++ b/source3/rpc_server/rpc_handles.c
3 @@ -59,8 +59,11 @@ struct handle_list {
4  
5  static bool is_samr_lsa_pipe(const struct ndr_syntax_id *syntax)
6  {
7 -       return (ndr_syntax_id_equal(syntax, &ndr_table_samr.syntax_id)
8 -               || ndr_syntax_id_equal(syntax, &ndr_table_lsarpc.syntax_id));
9 +       return
10 +#ifdef SAMR_SUPPORT
11 +               ndr_syntax_id_equal(syntax, &ndr_table_samr.syntax_id) ||
12 +#endif
13 +               ndr_syntax_id_equal(syntax, &ndr_table_lsarpc.syntax_id);
14  }
15  
16  size_t num_pipe_handles(struct pipes_struct *p)
17 --- a/source3/librpc/rpc/rpc_common.c
18 +++ b/source3/librpc/rpc/rpc_common.c
19 @@ -100,9 +100,11 @@ static bool initialize_interfaces(void)
20                 return false;
21         }
22  #endif
23 +#ifdef SAMR_SUPPORT
24         if (!smb_register_ndr_interface(&ndr_table_samr)) {
25                 return false;
26         }
27 +#endif
28  #ifdef NETLOGON_SUPPORT
29         if (!smb_register_ndr_interface(&ndr_table_netlogon)) {
30                 return false;
31 --- a/source3/rpc_server/rpc_ep_setup.c
32 +++ b/source3/rpc_server/rpc_ep_setup.c
33 @@ -557,6 +557,7 @@ static bool lsarpc_init_cb(void *ptr)
34         return true;
35  }
36  
37 +#ifdef SAMR_SUPPORT
38  static bool samr_init_cb(void *ptr)
39  {
40         struct dcesrv_ep_context *ep_ctx =
41 @@ -605,6 +606,7 @@ static bool samr_init_cb(void *ptr)
42  
43         return true;
44  }
45 +#endif
46  
47  #ifdef NETLOGON_SUPPORT
48  static bool netlogon_init_cb(void *ptr)
49 @@ -1111,12 +1113,14 @@ bool dcesrv_ep_setup(struct tevent_conte
50                 return false;
51         }
52  
53 +#ifdef SAMR_SUPPORT
54         samr_cb.init         = samr_init_cb;
55         samr_cb.shutdown     = NULL;
56         samr_cb.private_data = ep_ctx;
57         if (!NT_STATUS_IS_OK(rpc_samr_init(&samr_cb))) {
58                 return false;
59         }
60 +#endif
61  
62  #ifdef NETLOGON_SUPPORT
63         netlogon_cb.init         = netlogon_init_cb;
64 --- a/source3/smbd/server_exit.c
65 +++ b/source3/smbd/server_exit.c
66 @@ -159,7 +159,9 @@ static void exit_server_common(enum serv
67  #ifdef NETLOGON_SUPPORT
68                 rpc_netlogon_shutdown();
69  #endif
70 +#ifdef SAMR_SUPPORT
71                 rpc_samr_shutdown();
72 +#endif
73                 rpc_lsarpc_shutdown();
74         }
75  
76 --- a/source3/rpcclient/rpcclient.c
77 +++ b/source3/rpcclient/rpcclient.c
78 @@ -623,7 +623,9 @@ static struct cmd_set *rpcclient_command
79         rpcclient_commands,
80         lsarpc_commands,
81         ds_commands,
82 +#ifdef SAMR_SUPPORT
83         samr_commands,
84 +#endif
85  #ifdef PRINTER_SUPPORT
86         spoolss_commands,
87  #endif
88 --- a/source3/smbd/lanman.c
89 +++ b/source3/smbd/lanman.c
90 @@ -2353,6 +2353,10 @@ static bool api_RNetGroupEnum(struct smb
91         NTSTATUS status, result;
92         struct dcerpc_binding_handle *b;
93  
94 +#ifndef SAMR_SUPPORT
95 +       return False;
96 +#endif
97 +
98         if (!str1 || !str2 || !p) {
99                 return False;
100         }
101 @@ -2541,6 +2545,10 @@ static bool api_NetUserGetGroups(struct
102         NTSTATUS status, result;
103         struct dcerpc_binding_handle *b;
104  
105 +#ifndef SAMR_SUPPORT
106 +       return False;
107 +#endif
108 +
109         if (!str1 || !str2 || !UserName || !p) {
110                 return False;
111         }
112 @@ -2741,6 +2749,10 @@ static bool api_RNetUserEnum(struct smbd
113  
114         struct dcerpc_binding_handle *b;
115  
116 +#ifndef SAMR_SUPPORT
117 +       return False;
118 +#endif
119 +
120         if (!str1 || !str2 || !p) {
121                 return False;
122         }
123 @@ -2979,6 +2991,10 @@ static bool api_SamOEMChangePassword(str
124         int bufsize;
125         struct dcerpc_binding_handle *b;
126  
127 +#ifndef SAMR_SUPPORT
128 +       return False;
129 +#endif
130 +
131         *rparam_len = 4;
132         *rparam = smb_realloc_limit(*rparam,*rparam_len);
133         if (!*rparam) {
134 @@ -4020,6 +4036,10 @@ static bool api_RNetUserGetInfo(struct s
135         union samr_UserInfo *info;
136         struct dcerpc_binding_handle *b = NULL;
137  
138 +#ifndef SAMR_SUPPORT
139 +       return False;
140 +#endif
141 +
142         if (!str1 || !str2 || !UserName || !p) {
143                 return False;
144         }