Line data Source code
1 : /* s3 compat server functions auto-generated by pidl */
2 : #include "bin/default/librpc/gen_ndr/ndr_netlogon.h"
3 : #include "bin/default/librpc/gen_ndr/ndr_netlogon_scompat.h"
4 : #include <librpc/rpc/dcesrv_core.h>
5 : #include <rpc_server/rpc_config.h>
6 : #include <rpc_server/rpc_server.h>
7 : #include <util/debug.h>
8 :
9 : enum s3compat_rpc_dispatch {
10 : S3COMPAT_RPC_DISPATCH_EXTERNAL = 0x00000001,
11 : S3COMPAT_RPC_DISPATCH_INTERNAL = 0x00000002,
12 : };
13 :
14 : /* netlogon - dcerpc server boilerplate generated by pidl */
15 92 : static NTSTATUS netlogon__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
16 : {
17 92 : struct pipes_struct *p = NULL;
18 :
19 : /* Retrieve pipes struct */
20 92 : p = dcesrv_get_pipes_struct(context->conn);
21 92 : p->pipe_bound = true;
22 : #ifdef DCESRV_INTERFACE_NETLOGON_BIND
23 : return DCESRV_INTERFACE_NETLOGON_BIND(context,iface);
24 : #else
25 92 : return NT_STATUS_OK;
26 : #endif
27 : }
28 :
29 90 : static void netlogon__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
30 : {
31 : #ifdef DCESRV_INTERFACE_NETLOGON_UNBIND
32 : DCESRV_INTERFACE_NETLOGON_UNBIND(context, iface);
33 : #else
34 90 : return;
35 : #endif
36 : }
37 :
38 2089 : NTSTATUS netlogon__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
39 : {
40 : enum ndr_err_code ndr_err;
41 2089 : uint16_t opnum = dce_call->pkt.u.request.opnum;
42 :
43 2089 : dce_call->fault_code = 0;
44 :
45 2089 : if (opnum >= ndr_table_netlogon.num_calls) {
46 0 : dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
47 0 : return NT_STATUS_NET_WRITE_FAULT;
48 : }
49 :
50 2089 : *r = talloc_named(mem_ctx, ndr_table_netlogon.calls[opnum].struct_size, "struct %s", ndr_table_netlogon.calls[opnum].name);
51 2089 : NT_STATUS_HAVE_NO_MEMORY(*r);
52 :
53 : /* unravel the NDR for the packet */
54 2089 : ndr_err = ndr_table_netlogon.calls[opnum].ndr_pull(pull, NDR_IN, *r);
55 2089 : if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
56 0 : dce_call->fault_code = DCERPC_FAULT_NDR;
57 0 : return NT_STATUS_NET_WRITE_FAULT;
58 : }
59 :
60 2089 : return NT_STATUS_OK;
61 : }
62 :
63 2089 : static NTSTATUS netlogon__op_dispatch_internal(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r, enum s3compat_rpc_dispatch dispatch)
64 : {
65 2089 : uint16_t opnum = dce_call->pkt.u.request.opnum;
66 2089 : struct pipes_struct *p = NULL;
67 2089 : struct auth_session_info *pipe_session_info = NULL;
68 2089 : NTSTATUS status = NT_STATUS_OK;
69 2089 : bool impersonated = false;
70 :
71 : /* Retrieve pipes struct */
72 2089 : p = dcesrv_get_pipes_struct(dce_call->conn);
73 : /* Update pipes struct opnum */
74 2089 : p->opnum = opnum;
75 2089 : p->dce_call = dce_call;
76 2089 : p->mem_ctx = mem_ctx;
77 : /* Update pipes struct session info */
78 2089 : pipe_session_info = p->session_info;
79 2089 : p->session_info = dce_call->auth_state->session_info;
80 2089 : p->auth.auth_type = dce_call->auth_state->auth_type;
81 2089 : p->auth.auth_level = dce_call->auth_state->auth_level;
82 2089 : p->auth.auth_context_id = dce_call->auth_state->auth_context_id;
83 : /* Reset pipes struct fault state */
84 2089 : p->fault_state = 0;
85 :
86 : /* Impersonate */
87 2089 : if (dispatch == S3COMPAT_RPC_DISPATCH_EXTERNAL) {
88 2089 : impersonated = become_authenticated_pipe_user(p->session_info);
89 2089 : if (!impersonated) {
90 0 : dce_call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
91 0 : status = NT_STATUS_NET_WRITE_FAULT;
92 0 : goto fail;
93 : }
94 : }
95 :
96 2089 : switch (opnum) {
97 0 : case 0: { /* netr_LogonUasLogon */
98 0 : struct netr_LogonUasLogon *r2 = (struct netr_LogonUasLogon *)r;
99 0 : if (DEBUGLEVEL >= 10) {
100 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonUasLogon, NDR_IN, r2);
101 : }
102 0 : NDR_ZERO_STRUCT(r2->out);
103 0 : r2->out.info = talloc_zero(r2, struct netr_UasInfo *);
104 0 : if (r2->out.info == NULL) {
105 0 : status = NT_STATUS_NO_MEMORY;
106 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
107 0 : goto fail;
108 : }
109 :
110 0 : r2->out.result = _netr_LogonUasLogon(p, r2);
111 0 : break;
112 : }
113 0 : case 1: { /* netr_LogonUasLogoff */
114 0 : struct netr_LogonUasLogoff *r2 = (struct netr_LogonUasLogoff *)r;
115 0 : if (DEBUGLEVEL >= 10) {
116 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonUasLogoff, NDR_IN, r2);
117 : }
118 0 : NDR_ZERO_STRUCT(r2->out);
119 0 : r2->out.info = talloc_zero(r2, struct netr_UasLogoffInfo);
120 0 : if (r2->out.info == NULL) {
121 0 : status = NT_STATUS_NO_MEMORY;
122 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
123 0 : goto fail;
124 : }
125 :
126 0 : r2->out.result = _netr_LogonUasLogoff(p, r2);
127 0 : break;
128 : }
129 384 : case 2: { /* netr_LogonSamLogon */
130 384 : struct netr_LogonSamLogon *r2 = (struct netr_LogonSamLogon *)r;
131 384 : if (DEBUGLEVEL >= 10) {
132 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogon, NDR_IN, r2);
133 : }
134 384 : NDR_ZERO_STRUCT(r2->out);
135 384 : r2->out.return_authenticator = r2->in.return_authenticator;
136 384 : r2->out.validation = talloc_zero(r2, union netr_Validation);
137 384 : if (r2->out.validation == NULL) {
138 0 : status = NT_STATUS_NO_MEMORY;
139 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
140 0 : goto fail;
141 : }
142 :
143 384 : r2->out.authoritative = talloc_zero(r2, uint8_t);
144 384 : if (r2->out.authoritative == NULL) {
145 0 : status = NT_STATUS_NO_MEMORY;
146 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
147 0 : goto fail;
148 : }
149 :
150 384 : r2->out.result = _netr_LogonSamLogon(p, r2);
151 384 : break;
152 : }
153 0 : case 3: { /* netr_LogonSamLogoff */
154 0 : struct netr_LogonSamLogoff *r2 = (struct netr_LogonSamLogoff *)r;
155 0 : if (DEBUGLEVEL >= 10) {
156 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogoff, NDR_IN, r2);
157 : }
158 0 : NDR_ZERO_STRUCT(r2->out);
159 0 : r2->out.return_authenticator = r2->in.return_authenticator;
160 0 : r2->out.result = _netr_LogonSamLogoff(p, r2);
161 0 : break;
162 : }
163 595 : case 4: { /* netr_ServerReqChallenge */
164 595 : struct netr_ServerReqChallenge *r2 = (struct netr_ServerReqChallenge *)r;
165 595 : if (DEBUGLEVEL >= 10) {
166 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerReqChallenge, NDR_IN, r2);
167 : }
168 595 : NDR_ZERO_STRUCT(r2->out);
169 595 : r2->out.return_credentials = talloc_zero(r2, struct netr_Credential);
170 595 : if (r2->out.return_credentials == NULL) {
171 0 : status = NT_STATUS_NO_MEMORY;
172 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
173 0 : goto fail;
174 : }
175 :
176 595 : r2->out.result = _netr_ServerReqChallenge(p, r2);
177 595 : break;
178 : }
179 0 : case 5: { /* netr_ServerAuthenticate */
180 0 : struct netr_ServerAuthenticate *r2 = (struct netr_ServerAuthenticate *)r;
181 0 : if (DEBUGLEVEL >= 10) {
182 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate, NDR_IN, r2);
183 : }
184 0 : NDR_ZERO_STRUCT(r2->out);
185 0 : r2->out.return_credentials = talloc_zero(r2, struct netr_Credential);
186 0 : if (r2->out.return_credentials == NULL) {
187 0 : status = NT_STATUS_NO_MEMORY;
188 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
189 0 : goto fail;
190 : }
191 :
192 0 : r2->out.result = _netr_ServerAuthenticate(p, r2);
193 0 : break;
194 : }
195 8 : case 6: { /* netr_ServerPasswordSet */
196 8 : struct netr_ServerPasswordSet *r2 = (struct netr_ServerPasswordSet *)r;
197 8 : if (DEBUGLEVEL >= 10) {
198 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordSet, NDR_IN, r2);
199 : }
200 8 : NDR_ZERO_STRUCT(r2->out);
201 8 : r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
202 8 : if (r2->out.return_authenticator == NULL) {
203 0 : status = NT_STATUS_NO_MEMORY;
204 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
205 0 : goto fail;
206 : }
207 :
208 8 : r2->out.result = _netr_ServerPasswordSet(p, r2);
209 8 : break;
210 : }
211 0 : case 7: { /* netr_DatabaseDeltas */
212 0 : struct netr_DatabaseDeltas *r2 = (struct netr_DatabaseDeltas *)r;
213 0 : if (DEBUGLEVEL >= 10) {
214 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseDeltas, NDR_IN, r2);
215 : }
216 0 : NDR_ZERO_STRUCT(r2->out);
217 0 : r2->out.return_authenticator = r2->in.return_authenticator;
218 0 : r2->out.sequence_num = r2->in.sequence_num;
219 0 : r2->out.delta_enum_array = talloc_zero(r2, struct netr_DELTA_ENUM_ARRAY *);
220 0 : if (r2->out.delta_enum_array == NULL) {
221 0 : status = NT_STATUS_NO_MEMORY;
222 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
223 0 : goto fail;
224 : }
225 :
226 0 : r2->out.result = _netr_DatabaseDeltas(p, r2);
227 0 : break;
228 : }
229 0 : case 8: { /* netr_DatabaseSync */
230 0 : struct netr_DatabaseSync *r2 = (struct netr_DatabaseSync *)r;
231 0 : if (DEBUGLEVEL >= 10) {
232 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseSync, NDR_IN, r2);
233 : }
234 0 : NDR_ZERO_STRUCT(r2->out);
235 0 : r2->out.return_authenticator = r2->in.return_authenticator;
236 0 : r2->out.sync_context = r2->in.sync_context;
237 0 : r2->out.delta_enum_array = talloc_zero(r2, struct netr_DELTA_ENUM_ARRAY *);
238 0 : if (r2->out.delta_enum_array == NULL) {
239 0 : status = NT_STATUS_NO_MEMORY;
240 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
241 0 : goto fail;
242 : }
243 :
244 0 : r2->out.result = _netr_DatabaseSync(p, r2);
245 0 : break;
246 : }
247 0 : case 9: { /* netr_AccountDeltas */
248 0 : struct netr_AccountDeltas *r2 = (struct netr_AccountDeltas *)r;
249 0 : if (DEBUGLEVEL >= 10) {
250 0 : NDR_PRINT_FUNCTION_DEBUG(netr_AccountDeltas, NDR_IN, r2);
251 : }
252 0 : NDR_ZERO_STRUCT(r2->out);
253 0 : r2->out.return_authenticator = r2->in.return_authenticator;
254 0 : r2->out.buffer = talloc_zero(r2, struct netr_AccountBuffer);
255 0 : if (r2->out.buffer == NULL) {
256 0 : status = NT_STATUS_NO_MEMORY;
257 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
258 0 : goto fail;
259 : }
260 :
261 0 : r2->out.count_returned = talloc_zero(r2, uint32_t);
262 0 : if (r2->out.count_returned == NULL) {
263 0 : status = NT_STATUS_NO_MEMORY;
264 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
265 0 : goto fail;
266 : }
267 :
268 0 : r2->out.total_entries = talloc_zero(r2, uint32_t);
269 0 : if (r2->out.total_entries == NULL) {
270 0 : status = NT_STATUS_NO_MEMORY;
271 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
272 0 : goto fail;
273 : }
274 :
275 0 : r2->out.recordid = talloc_zero(r2, struct netr_UAS_INFO_0);
276 0 : if (r2->out.recordid == NULL) {
277 0 : status = NT_STATUS_NO_MEMORY;
278 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
279 0 : goto fail;
280 : }
281 :
282 0 : r2->out.result = _netr_AccountDeltas(p, r2);
283 0 : break;
284 : }
285 0 : case 10: { /* netr_AccountSync */
286 0 : struct netr_AccountSync *r2 = (struct netr_AccountSync *)r;
287 0 : if (DEBUGLEVEL >= 10) {
288 0 : NDR_PRINT_FUNCTION_DEBUG(netr_AccountSync, NDR_IN, r2);
289 : }
290 0 : NDR_ZERO_STRUCT(r2->out);
291 0 : r2->out.return_authenticator = r2->in.return_authenticator;
292 0 : r2->out.recordid = r2->in.recordid;
293 0 : r2->out.buffer = talloc_zero(r2, struct netr_AccountBuffer);
294 0 : if (r2->out.buffer == NULL) {
295 0 : status = NT_STATUS_NO_MEMORY;
296 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
297 0 : goto fail;
298 : }
299 :
300 0 : r2->out.count_returned = talloc_zero(r2, uint32_t);
301 0 : if (r2->out.count_returned == NULL) {
302 0 : status = NT_STATUS_NO_MEMORY;
303 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
304 0 : goto fail;
305 : }
306 :
307 0 : r2->out.total_entries = talloc_zero(r2, uint32_t);
308 0 : if (r2->out.total_entries == NULL) {
309 0 : status = NT_STATUS_NO_MEMORY;
310 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
311 0 : goto fail;
312 : }
313 :
314 0 : r2->out.next_reference = talloc_zero(r2, uint32_t);
315 0 : if (r2->out.next_reference == NULL) {
316 0 : status = NT_STATUS_NO_MEMORY;
317 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
318 0 : goto fail;
319 : }
320 :
321 0 : r2->out.result = _netr_AccountSync(p, r2);
322 0 : break;
323 : }
324 0 : case 11: { /* netr_GetDcName */
325 0 : struct netr_GetDcName *r2 = (struct netr_GetDcName *)r;
326 0 : if (DEBUGLEVEL >= 10) {
327 0 : NDR_PRINT_FUNCTION_DEBUG(netr_GetDcName, NDR_IN, r2);
328 : }
329 0 : NDR_ZERO_STRUCT(r2->out);
330 0 : r2->out.dcname = talloc_zero(r2, const char *);
331 0 : if (r2->out.dcname == NULL) {
332 0 : status = NT_STATUS_NO_MEMORY;
333 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
334 0 : goto fail;
335 : }
336 :
337 0 : r2->out.result = _netr_GetDcName(p, r2);
338 0 : break;
339 : }
340 260 : case 12: { /* netr_LogonControl */
341 260 : struct netr_LogonControl *r2 = (struct netr_LogonControl *)r;
342 260 : if (DEBUGLEVEL >= 10) {
343 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl, NDR_IN, r2);
344 : }
345 260 : NDR_ZERO_STRUCT(r2->out);
346 260 : r2->out.query = talloc_zero(r2, union netr_CONTROL_QUERY_INFORMATION);
347 260 : if (r2->out.query == NULL) {
348 0 : status = NT_STATUS_NO_MEMORY;
349 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
350 0 : goto fail;
351 : }
352 :
353 260 : r2->out.result = _netr_LogonControl(p, r2);
354 260 : break;
355 : }
356 0 : case 13: { /* netr_GetAnyDCName */
357 0 : struct netr_GetAnyDCName *r2 = (struct netr_GetAnyDCName *)r;
358 0 : if (DEBUGLEVEL >= 10) {
359 0 : NDR_PRINT_FUNCTION_DEBUG(netr_GetAnyDCName, NDR_IN, r2);
360 : }
361 0 : NDR_ZERO_STRUCT(r2->out);
362 0 : r2->out.dcname = talloc_zero(r2, const char *);
363 0 : if (r2->out.dcname == NULL) {
364 0 : status = NT_STATUS_NO_MEMORY;
365 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
366 0 : goto fail;
367 : }
368 :
369 0 : r2->out.result = _netr_GetAnyDCName(p, r2);
370 0 : break;
371 : }
372 56 : case 14: { /* netr_LogonControl2 */
373 56 : struct netr_LogonControl2 *r2 = (struct netr_LogonControl2 *)r;
374 56 : if (DEBUGLEVEL >= 10) {
375 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl2, NDR_IN, r2);
376 : }
377 56 : NDR_ZERO_STRUCT(r2->out);
378 56 : r2->out.query = talloc_zero(r2, union netr_CONTROL_QUERY_INFORMATION);
379 56 : if (r2->out.query == NULL) {
380 0 : status = NT_STATUS_NO_MEMORY;
381 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
382 0 : goto fail;
383 : }
384 :
385 56 : r2->out.result = _netr_LogonControl2(p, r2);
386 56 : break;
387 : }
388 42 : case 15: { /* netr_ServerAuthenticate2 */
389 42 : struct netr_ServerAuthenticate2 *r2 = (struct netr_ServerAuthenticate2 *)r;
390 42 : if (DEBUGLEVEL >= 10) {
391 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate2, NDR_IN, r2);
392 : }
393 42 : NDR_ZERO_STRUCT(r2->out);
394 42 : r2->out.negotiate_flags = r2->in.negotiate_flags;
395 42 : r2->out.return_credentials = talloc_zero(r2, struct netr_Credential);
396 42 : if (r2->out.return_credentials == NULL) {
397 0 : status = NT_STATUS_NO_MEMORY;
398 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
399 0 : goto fail;
400 : }
401 :
402 42 : r2->out.result = _netr_ServerAuthenticate2(p, r2);
403 42 : break;
404 : }
405 0 : case 16: { /* netr_DatabaseSync2 */
406 0 : struct netr_DatabaseSync2 *r2 = (struct netr_DatabaseSync2 *)r;
407 0 : if (DEBUGLEVEL >= 10) {
408 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseSync2, NDR_IN, r2);
409 : }
410 0 : NDR_ZERO_STRUCT(r2->out);
411 0 : r2->out.return_authenticator = r2->in.return_authenticator;
412 0 : r2->out.sync_context = r2->in.sync_context;
413 0 : r2->out.delta_enum_array = talloc_zero(r2, struct netr_DELTA_ENUM_ARRAY *);
414 0 : if (r2->out.delta_enum_array == NULL) {
415 0 : status = NT_STATUS_NO_MEMORY;
416 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
417 0 : goto fail;
418 : }
419 :
420 0 : r2->out.result = _netr_DatabaseSync2(p, r2);
421 0 : break;
422 : }
423 0 : case 17: { /* netr_DatabaseRedo */
424 0 : struct netr_DatabaseRedo *r2 = (struct netr_DatabaseRedo *)r;
425 0 : if (DEBUGLEVEL >= 10) {
426 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseRedo, NDR_IN, r2);
427 : }
428 0 : NDR_ZERO_STRUCT(r2->out);
429 0 : r2->out.return_authenticator = r2->in.return_authenticator;
430 0 : r2->out.delta_enum_array = talloc_zero(r2, struct netr_DELTA_ENUM_ARRAY *);
431 0 : if (r2->out.delta_enum_array == NULL) {
432 0 : status = NT_STATUS_NO_MEMORY;
433 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
434 0 : goto fail;
435 : }
436 :
437 0 : r2->out.result = _netr_DatabaseRedo(p, r2);
438 0 : break;
439 : }
440 56 : case 18: { /* netr_LogonControl2Ex */
441 56 : struct netr_LogonControl2Ex *r2 = (struct netr_LogonControl2Ex *)r;
442 56 : if (DEBUGLEVEL >= 10) {
443 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl2Ex, NDR_IN, r2);
444 : }
445 56 : NDR_ZERO_STRUCT(r2->out);
446 56 : r2->out.query = talloc_zero(r2, union netr_CONTROL_QUERY_INFORMATION);
447 56 : if (r2->out.query == NULL) {
448 0 : status = NT_STATUS_NO_MEMORY;
449 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
450 0 : goto fail;
451 : }
452 :
453 56 : r2->out.result = _netr_LogonControl2Ex(p, r2);
454 56 : break;
455 : }
456 0 : case 19: { /* netr_NetrEnumerateTrustedDomains */
457 0 : struct netr_NetrEnumerateTrustedDomains *r2 = (struct netr_NetrEnumerateTrustedDomains *)r;
458 0 : if (DEBUGLEVEL >= 10) {
459 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NetrEnumerateTrustedDomains, NDR_IN, r2);
460 : }
461 0 : NDR_ZERO_STRUCT(r2->out);
462 0 : r2->out.trusted_domains_blob = talloc_zero(r2, struct netr_Blob);
463 0 : if (r2->out.trusted_domains_blob == NULL) {
464 0 : status = NT_STATUS_NO_MEMORY;
465 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
466 0 : goto fail;
467 : }
468 :
469 0 : r2->out.result = _netr_NetrEnumerateTrustedDomains(p, r2);
470 0 : break;
471 : }
472 0 : case 20: { /* netr_DsRGetDCName */
473 0 : struct netr_DsRGetDCName *r2 = (struct netr_DsRGetDCName *)r;
474 0 : if (DEBUGLEVEL >= 10) {
475 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCName, NDR_IN, r2);
476 : }
477 0 : NDR_ZERO_STRUCT(r2->out);
478 0 : r2->out.info = talloc_zero(r2, struct netr_DsRGetDCNameInfo *);
479 0 : if (r2->out.info == NULL) {
480 0 : status = NT_STATUS_NO_MEMORY;
481 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
482 0 : goto fail;
483 : }
484 :
485 0 : r2->out.result = _netr_DsRGetDCName(p, r2);
486 0 : break;
487 : }
488 33 : case 21: { /* netr_LogonGetCapabilities */
489 33 : struct netr_LogonGetCapabilities *r2 = (struct netr_LogonGetCapabilities *)r;
490 33 : if (DEBUGLEVEL >= 10) {
491 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetCapabilities, NDR_IN, r2);
492 : }
493 33 : NDR_ZERO_STRUCT(r2->out);
494 33 : r2->out.return_authenticator = r2->in.return_authenticator;
495 33 : r2->out.capabilities = talloc_zero(r2, union netr_Capabilities);
496 33 : if (r2->out.capabilities == NULL) {
497 0 : status = NT_STATUS_NO_MEMORY;
498 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
499 0 : goto fail;
500 : }
501 :
502 33 : r2->out.result = _netr_LogonGetCapabilities(p, r2);
503 33 : break;
504 : }
505 0 : case 22: { /* netr_NETRLOGONSETSERVICEBITS */
506 0 : struct netr_NETRLOGONSETSERVICEBITS *r2 = (struct netr_NETRLOGONSETSERVICEBITS *)r;
507 0 : if (DEBUGLEVEL >= 10) {
508 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONSETSERVICEBITS, NDR_IN, r2);
509 : }
510 0 : r2->out.result = _netr_NETRLOGONSETSERVICEBITS(p, r2);
511 0 : break;
512 : }
513 0 : case 23: { /* netr_LogonGetTrustRid */
514 0 : struct netr_LogonGetTrustRid *r2 = (struct netr_LogonGetTrustRid *)r;
515 0 : if (DEBUGLEVEL >= 10) {
516 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetTrustRid, NDR_IN, r2);
517 : }
518 0 : NDR_ZERO_STRUCT(r2->out);
519 0 : r2->out.rid = talloc_zero(r2, uint32_t);
520 0 : if (r2->out.rid == NULL) {
521 0 : status = NT_STATUS_NO_MEMORY;
522 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
523 0 : goto fail;
524 : }
525 :
526 0 : r2->out.result = _netr_LogonGetTrustRid(p, r2);
527 0 : break;
528 : }
529 0 : case 24: { /* netr_NETRLOGONCOMPUTESERVERDIGEST */
530 0 : struct netr_NETRLOGONCOMPUTESERVERDIGEST *r2 = (struct netr_NETRLOGONCOMPUTESERVERDIGEST *)r;
531 0 : if (DEBUGLEVEL >= 10) {
532 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, NDR_IN, r2);
533 : }
534 0 : r2->out.result = _netr_NETRLOGONCOMPUTESERVERDIGEST(p, r2);
535 0 : break;
536 : }
537 0 : case 25: { /* netr_NETRLOGONCOMPUTECLIENTDIGEST */
538 0 : struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r2 = (struct netr_NETRLOGONCOMPUTECLIENTDIGEST *)r;
539 0 : if (DEBUGLEVEL >= 10) {
540 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, NDR_IN, r2);
541 : }
542 0 : r2->out.result = _netr_NETRLOGONCOMPUTECLIENTDIGEST(p, r2);
543 0 : break;
544 : }
545 8 : case 26: { /* netr_ServerAuthenticate3 */
546 8 : struct netr_ServerAuthenticate3 *r2 = (struct netr_ServerAuthenticate3 *)r;
547 8 : if (DEBUGLEVEL >= 10) {
548 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate3, NDR_IN, r2);
549 : }
550 8 : NDR_ZERO_STRUCT(r2->out);
551 8 : r2->out.negotiate_flags = r2->in.negotiate_flags;
552 8 : r2->out.return_credentials = talloc_zero(r2, struct netr_Credential);
553 8 : if (r2->out.return_credentials == NULL) {
554 0 : status = NT_STATUS_NO_MEMORY;
555 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
556 0 : goto fail;
557 : }
558 :
559 8 : r2->out.rid = talloc_zero(r2, uint32_t);
560 8 : if (r2->out.rid == NULL) {
561 0 : status = NT_STATUS_NO_MEMORY;
562 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
563 0 : goto fail;
564 : }
565 :
566 8 : r2->out.result = _netr_ServerAuthenticate3(p, r2);
567 8 : break;
568 : }
569 0 : case 27: { /* netr_DsRGetDCNameEx */
570 0 : struct netr_DsRGetDCNameEx *r2 = (struct netr_DsRGetDCNameEx *)r;
571 0 : if (DEBUGLEVEL >= 10) {
572 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCNameEx, NDR_IN, r2);
573 : }
574 0 : NDR_ZERO_STRUCT(r2->out);
575 0 : r2->out.info = talloc_zero(r2, struct netr_DsRGetDCNameInfo *);
576 0 : if (r2->out.info == NULL) {
577 0 : status = NT_STATUS_NO_MEMORY;
578 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
579 0 : goto fail;
580 : }
581 :
582 0 : r2->out.result = _netr_DsRGetDCNameEx(p, r2);
583 0 : break;
584 : }
585 0 : case 28: { /* netr_DsRGetSiteName */
586 0 : struct netr_DsRGetSiteName *r2 = (struct netr_DsRGetSiteName *)r;
587 0 : if (DEBUGLEVEL >= 10) {
588 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetSiteName, NDR_IN, r2);
589 : }
590 0 : NDR_ZERO_STRUCT(r2->out);
591 0 : r2->out.site = talloc_zero(r2, const char *);
592 0 : if (r2->out.site == NULL) {
593 0 : status = NT_STATUS_NO_MEMORY;
594 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
595 0 : goto fail;
596 : }
597 :
598 0 : r2->out.result = _netr_DsRGetSiteName(p, r2);
599 0 : break;
600 : }
601 0 : case 29: { /* netr_LogonGetDomainInfo */
602 0 : struct netr_LogonGetDomainInfo *r2 = (struct netr_LogonGetDomainInfo *)r;
603 0 : if (DEBUGLEVEL >= 10) {
604 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetDomainInfo, NDR_IN, r2);
605 : }
606 0 : NDR_ZERO_STRUCT(r2->out);
607 0 : r2->out.return_authenticator = r2->in.return_authenticator;
608 0 : r2->out.info = talloc_zero(r2, union netr_DomainInfo);
609 0 : if (r2->out.info == NULL) {
610 0 : status = NT_STATUS_NO_MEMORY;
611 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
612 0 : goto fail;
613 : }
614 :
615 0 : r2->out.result = _netr_LogonGetDomainInfo(p, r2);
616 0 : break;
617 : }
618 8 : case 30: { /* netr_ServerPasswordSet2 */
619 8 : struct netr_ServerPasswordSet2 *r2 = (struct netr_ServerPasswordSet2 *)r;
620 8 : if (DEBUGLEVEL >= 10) {
621 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordSet2, NDR_IN, r2);
622 : }
623 8 : NDR_ZERO_STRUCT(r2->out);
624 8 : r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
625 8 : if (r2->out.return_authenticator == NULL) {
626 0 : status = NT_STATUS_NO_MEMORY;
627 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
628 0 : goto fail;
629 : }
630 :
631 8 : r2->out.result = _netr_ServerPasswordSet2(p, r2);
632 8 : break;
633 : }
634 0 : case 31: { /* netr_ServerPasswordGet */
635 0 : struct netr_ServerPasswordGet *r2 = (struct netr_ServerPasswordGet *)r;
636 0 : if (DEBUGLEVEL >= 10) {
637 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordGet, NDR_IN, r2);
638 : }
639 0 : NDR_ZERO_STRUCT(r2->out);
640 0 : r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
641 0 : if (r2->out.return_authenticator == NULL) {
642 0 : status = NT_STATUS_NO_MEMORY;
643 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
644 0 : goto fail;
645 : }
646 :
647 0 : r2->out.password = talloc_zero(r2, struct samr_Password);
648 0 : if (r2->out.password == NULL) {
649 0 : status = NT_STATUS_NO_MEMORY;
650 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
651 0 : goto fail;
652 : }
653 :
654 0 : r2->out.result = _netr_ServerPasswordGet(p, r2);
655 0 : break;
656 : }
657 0 : case 32: { /* netr_NetrLogonSendToSam */
658 0 : struct netr_NetrLogonSendToSam *r2 = (struct netr_NetrLogonSendToSam *)r;
659 0 : if (DEBUGLEVEL >= 10) {
660 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NetrLogonSendToSam, NDR_IN, r2);
661 : }
662 0 : NDR_ZERO_STRUCT(r2->out);
663 0 : r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
664 0 : if (r2->out.return_authenticator == NULL) {
665 0 : status = NT_STATUS_NO_MEMORY;
666 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
667 0 : goto fail;
668 : }
669 :
670 0 : r2->out.result = _netr_NetrLogonSendToSam(p, r2);
671 0 : break;
672 : }
673 0 : case 33: { /* netr_DsRAddressToSitenamesW */
674 0 : struct netr_DsRAddressToSitenamesW *r2 = (struct netr_DsRAddressToSitenamesW *)r;
675 0 : if (DEBUGLEVEL >= 10) {
676 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRAddressToSitenamesW, NDR_IN, r2);
677 : }
678 0 : NDR_ZERO_STRUCT(r2->out);
679 0 : r2->out.ctr = talloc_zero(r2, struct netr_DsRAddressToSitenamesWCtr *);
680 0 : if (r2->out.ctr == NULL) {
681 0 : status = NT_STATUS_NO_MEMORY;
682 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
683 0 : goto fail;
684 : }
685 :
686 0 : r2->out.result = _netr_DsRAddressToSitenamesW(p, r2);
687 0 : break;
688 : }
689 0 : case 34: { /* netr_DsRGetDCNameEx2 */
690 0 : struct netr_DsRGetDCNameEx2 *r2 = (struct netr_DsRGetDCNameEx2 *)r;
691 0 : if (DEBUGLEVEL >= 10) {
692 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCNameEx2, NDR_IN, r2);
693 : }
694 0 : NDR_ZERO_STRUCT(r2->out);
695 0 : r2->out.info = talloc_zero(r2, struct netr_DsRGetDCNameInfo *);
696 0 : if (r2->out.info == NULL) {
697 0 : status = NT_STATUS_NO_MEMORY;
698 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
699 0 : goto fail;
700 : }
701 :
702 0 : r2->out.result = _netr_DsRGetDCNameEx2(p, r2);
703 0 : break;
704 : }
705 0 : case 35: { /* netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN */
706 0 : struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r2 = (struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *)r;
707 0 : if (DEBUGLEVEL >= 10) {
708 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, NDR_IN, r2);
709 : }
710 0 : r2->out.result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(p, r2);
711 0 : break;
712 : }
713 0 : case 36: { /* netr_NetrEnumerateTrustedDomainsEx */
714 0 : struct netr_NetrEnumerateTrustedDomainsEx *r2 = (struct netr_NetrEnumerateTrustedDomainsEx *)r;
715 0 : if (DEBUGLEVEL >= 10) {
716 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NetrEnumerateTrustedDomainsEx, NDR_IN, r2);
717 : }
718 0 : NDR_ZERO_STRUCT(r2->out);
719 0 : r2->out.dom_trust_list = talloc_zero(r2, struct netr_DomainTrustList);
720 0 : if (r2->out.dom_trust_list == NULL) {
721 0 : status = NT_STATUS_NO_MEMORY;
722 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
723 0 : goto fail;
724 : }
725 :
726 0 : r2->out.result = _netr_NetrEnumerateTrustedDomainsEx(p, r2);
727 0 : break;
728 : }
729 0 : case 37: { /* netr_DsRAddressToSitenamesExW */
730 0 : struct netr_DsRAddressToSitenamesExW *r2 = (struct netr_DsRAddressToSitenamesExW *)r;
731 0 : if (DEBUGLEVEL >= 10) {
732 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRAddressToSitenamesExW, NDR_IN, r2);
733 : }
734 0 : NDR_ZERO_STRUCT(r2->out);
735 0 : r2->out.ctr = talloc_zero(r2, struct netr_DsRAddressToSitenamesExWCtr *);
736 0 : if (r2->out.ctr == NULL) {
737 0 : status = NT_STATUS_NO_MEMORY;
738 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
739 0 : goto fail;
740 : }
741 :
742 0 : r2->out.result = _netr_DsRAddressToSitenamesExW(p, r2);
743 0 : break;
744 : }
745 0 : case 38: { /* netr_DsrGetDcSiteCoverageW */
746 0 : struct netr_DsrGetDcSiteCoverageW *r2 = (struct netr_DsrGetDcSiteCoverageW *)r;
747 0 : if (DEBUGLEVEL >= 10) {
748 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsrGetDcSiteCoverageW, NDR_IN, r2);
749 : }
750 0 : NDR_ZERO_STRUCT(r2->out);
751 0 : r2->out.ctr = talloc_zero(r2, struct DcSitesCtr *);
752 0 : if (r2->out.ctr == NULL) {
753 0 : status = NT_STATUS_NO_MEMORY;
754 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
755 0 : goto fail;
756 : }
757 :
758 0 : r2->out.result = _netr_DsrGetDcSiteCoverageW(p, r2);
759 0 : break;
760 : }
761 639 : case 39: { /* netr_LogonSamLogonEx */
762 639 : struct netr_LogonSamLogonEx *r2 = (struct netr_LogonSamLogonEx *)r;
763 639 : if (DEBUGLEVEL >= 10) {
764 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogonEx, NDR_IN, r2);
765 : }
766 639 : NDR_ZERO_STRUCT(r2->out);
767 639 : r2->out.flags = r2->in.flags;
768 639 : r2->out.validation = talloc_zero(r2, union netr_Validation);
769 639 : if (r2->out.validation == NULL) {
770 0 : status = NT_STATUS_NO_MEMORY;
771 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
772 0 : goto fail;
773 : }
774 :
775 639 : r2->out.authoritative = talloc_zero(r2, uint8_t);
776 639 : if (r2->out.authoritative == NULL) {
777 0 : status = NT_STATUS_NO_MEMORY;
778 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
779 0 : goto fail;
780 : }
781 :
782 639 : r2->out.result = _netr_LogonSamLogonEx(p, r2);
783 639 : break;
784 : }
785 0 : case 40: { /* netr_DsrEnumerateDomainTrusts */
786 0 : struct netr_DsrEnumerateDomainTrusts *r2 = (struct netr_DsrEnumerateDomainTrusts *)r;
787 0 : if (DEBUGLEVEL >= 10) {
788 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsrEnumerateDomainTrusts, NDR_IN, r2);
789 : }
790 0 : NDR_ZERO_STRUCT(r2->out);
791 0 : r2->out.trusts = talloc_zero(r2, struct netr_DomainTrustList);
792 0 : if (r2->out.trusts == NULL) {
793 0 : status = NT_STATUS_NO_MEMORY;
794 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
795 0 : goto fail;
796 : }
797 :
798 0 : r2->out.result = _netr_DsrEnumerateDomainTrusts(p, r2);
799 0 : break;
800 : }
801 0 : case 41: { /* netr_DsrDeregisterDNSHostRecords */
802 0 : struct netr_DsrDeregisterDNSHostRecords *r2 = (struct netr_DsrDeregisterDNSHostRecords *)r;
803 0 : if (DEBUGLEVEL >= 10) {
804 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsrDeregisterDNSHostRecords, NDR_IN, r2);
805 : }
806 0 : r2->out.result = _netr_DsrDeregisterDNSHostRecords(p, r2);
807 0 : break;
808 : }
809 0 : case 42: { /* netr_ServerTrustPasswordsGet */
810 0 : struct netr_ServerTrustPasswordsGet *r2 = (struct netr_ServerTrustPasswordsGet *)r;
811 0 : if (DEBUGLEVEL >= 10) {
812 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerTrustPasswordsGet, NDR_IN, r2);
813 : }
814 0 : NDR_ZERO_STRUCT(r2->out);
815 0 : r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
816 0 : if (r2->out.return_authenticator == NULL) {
817 0 : status = NT_STATUS_NO_MEMORY;
818 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
819 0 : goto fail;
820 : }
821 :
822 0 : r2->out.new_owf_password = talloc_zero(r2, struct samr_Password);
823 0 : if (r2->out.new_owf_password == NULL) {
824 0 : status = NT_STATUS_NO_MEMORY;
825 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
826 0 : goto fail;
827 : }
828 :
829 0 : r2->out.old_owf_password = talloc_zero(r2, struct samr_Password);
830 0 : if (r2->out.old_owf_password == NULL) {
831 0 : status = NT_STATUS_NO_MEMORY;
832 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
833 0 : goto fail;
834 : }
835 :
836 0 : r2->out.result = _netr_ServerTrustPasswordsGet(p, r2);
837 0 : break;
838 : }
839 0 : case 43: { /* netr_DsRGetForestTrustInformation */
840 0 : struct netr_DsRGetForestTrustInformation *r2 = (struct netr_DsRGetForestTrustInformation *)r;
841 0 : if (DEBUGLEVEL >= 10) {
842 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetForestTrustInformation, NDR_IN, r2);
843 : }
844 0 : NDR_ZERO_STRUCT(r2->out);
845 0 : r2->out.forest_trust_info = talloc_zero(r2, struct lsa_ForestTrustInformation *);
846 0 : if (r2->out.forest_trust_info == NULL) {
847 0 : status = NT_STATUS_NO_MEMORY;
848 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
849 0 : goto fail;
850 : }
851 :
852 0 : r2->out.result = _netr_DsRGetForestTrustInformation(p, r2);
853 0 : break;
854 : }
855 0 : case 44: { /* netr_GetForestTrustInformation */
856 0 : struct netr_GetForestTrustInformation *r2 = (struct netr_GetForestTrustInformation *)r;
857 0 : if (DEBUGLEVEL >= 10) {
858 0 : NDR_PRINT_FUNCTION_DEBUG(netr_GetForestTrustInformation, NDR_IN, r2);
859 : }
860 0 : NDR_ZERO_STRUCT(r2->out);
861 0 : r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
862 0 : if (r2->out.return_authenticator == NULL) {
863 0 : status = NT_STATUS_NO_MEMORY;
864 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
865 0 : goto fail;
866 : }
867 :
868 0 : r2->out.forest_trust_info = talloc_zero(r2, struct lsa_ForestTrustInformation *);
869 0 : if (r2->out.forest_trust_info == NULL) {
870 0 : status = NT_STATUS_NO_MEMORY;
871 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
872 0 : goto fail;
873 : }
874 :
875 0 : r2->out.result = _netr_GetForestTrustInformation(p, r2);
876 0 : break;
877 : }
878 0 : case 45: { /* netr_LogonSamLogonWithFlags */
879 0 : struct netr_LogonSamLogonWithFlags *r2 = (struct netr_LogonSamLogonWithFlags *)r;
880 0 : if (DEBUGLEVEL >= 10) {
881 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogonWithFlags, NDR_IN, r2);
882 : }
883 0 : NDR_ZERO_STRUCT(r2->out);
884 0 : r2->out.return_authenticator = r2->in.return_authenticator;
885 0 : r2->out.flags = r2->in.flags;
886 0 : r2->out.validation = talloc_zero(r2, union netr_Validation);
887 0 : if (r2->out.validation == NULL) {
888 0 : status = NT_STATUS_NO_MEMORY;
889 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
890 0 : goto fail;
891 : }
892 :
893 0 : r2->out.authoritative = talloc_zero(r2, uint8_t);
894 0 : if (r2->out.authoritative == NULL) {
895 0 : status = NT_STATUS_NO_MEMORY;
896 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
897 0 : goto fail;
898 : }
899 :
900 0 : r2->out.result = _netr_LogonSamLogonWithFlags(p, r2);
901 0 : break;
902 : }
903 0 : case 46: { /* netr_ServerGetTrustInfo */
904 0 : struct netr_ServerGetTrustInfo *r2 = (struct netr_ServerGetTrustInfo *)r;
905 0 : if (DEBUGLEVEL >= 10) {
906 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerGetTrustInfo, NDR_IN, r2);
907 : }
908 0 : NDR_ZERO_STRUCT(r2->out);
909 0 : r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
910 0 : if (r2->out.return_authenticator == NULL) {
911 0 : status = NT_STATUS_NO_MEMORY;
912 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
913 0 : goto fail;
914 : }
915 :
916 0 : r2->out.new_owf_password = talloc_zero(r2, struct samr_Password);
917 0 : if (r2->out.new_owf_password == NULL) {
918 0 : status = NT_STATUS_NO_MEMORY;
919 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
920 0 : goto fail;
921 : }
922 :
923 0 : r2->out.old_owf_password = talloc_zero(r2, struct samr_Password);
924 0 : if (r2->out.old_owf_password == NULL) {
925 0 : status = NT_STATUS_NO_MEMORY;
926 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
927 0 : goto fail;
928 : }
929 :
930 0 : r2->out.trust_info = talloc_zero(r2, struct netr_TrustInfo *);
931 0 : if (r2->out.trust_info == NULL) {
932 0 : status = NT_STATUS_NO_MEMORY;
933 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
934 0 : goto fail;
935 : }
936 :
937 0 : r2->out.result = _netr_ServerGetTrustInfo(p, r2);
938 0 : break;
939 : }
940 0 : case 47: { /* netr_Unused47 */
941 0 : struct netr_Unused47 *r2 = (struct netr_Unused47 *)r;
942 0 : if (DEBUGLEVEL >= 10) {
943 0 : NDR_PRINT_FUNCTION_DEBUG(netr_Unused47, NDR_IN, r2);
944 : }
945 0 : r2->out.result = _netr_Unused47(p, r2);
946 0 : break;
947 : }
948 0 : case 48: { /* netr_DsrUpdateReadOnlyServerDnsRecords */
949 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *r2 = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)r;
950 0 : if (DEBUGLEVEL >= 10) {
951 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsrUpdateReadOnlyServerDnsRecords, NDR_IN, r2);
952 : }
953 0 : NDR_ZERO_STRUCT(r2->out);
954 0 : r2->out.dns_names = r2->in.dns_names;
955 0 : r2->out.return_authenticator = talloc_zero(r2, struct netr_Authenticator);
956 0 : if (r2->out.return_authenticator == NULL) {
957 0 : status = NT_STATUS_NO_MEMORY;
958 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
959 0 : goto fail;
960 : }
961 :
962 0 : r2->out.result = _netr_DsrUpdateReadOnlyServerDnsRecords(p, r2);
963 0 : break;
964 : }
965 0 : default:
966 0 : dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
967 0 : break;
968 : }
969 :
970 2089 : fail:
971 : /* Unimpersonate */
972 2089 : if (impersonated) {
973 2089 : unbecome_authenticated_pipe_user();
974 : }
975 :
976 2089 : p->dce_call = NULL;
977 2089 : p->mem_ctx = NULL;
978 : /* Restore session info */
979 2089 : p->session_info = pipe_session_info;
980 2089 : p->auth.auth_type = 0;
981 2089 : p->auth.auth_level = 0;
982 2089 : p->auth.auth_context_id = 0;
983 : /* Check pipes struct fault state */
984 2089 : if (p->fault_state != 0) {
985 0 : dce_call->fault_code = p->fault_state;
986 : }
987 2089 : if (dce_call->fault_code != 0) {
988 0 : status = NT_STATUS_NET_WRITE_FAULT;
989 : }
990 :
991 2089 : return status;
992 : }
993 :
994 2089 : NTSTATUS netlogon__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
995 : {
996 2089 : return netlogon__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_EXTERNAL);
997 : }
998 :
999 2089 : NTSTATUS netlogon__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
1000 : {
1001 2089 : uint16_t opnum = dce_call->pkt.u.request.opnum;
1002 :
1003 2089 : switch (opnum) {
1004 0 : case 0: { /* netr_LogonUasLogon */
1005 0 : struct netr_LogonUasLogon *r2 = (struct netr_LogonUasLogon *)r;
1006 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1007 0 : DEBUG(5,("function netr_LogonUasLogon replied async\n"));
1008 : }
1009 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1010 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonUasLogon, NDR_OUT | NDR_SET_VALUES, r2);
1011 : }
1012 0 : if (dce_call->fault_code != 0) {
1013 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonUasLogon\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1014 : }
1015 0 : break;
1016 : }
1017 0 : case 1: { /* netr_LogonUasLogoff */
1018 0 : struct netr_LogonUasLogoff *r2 = (struct netr_LogonUasLogoff *)r;
1019 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1020 0 : DEBUG(5,("function netr_LogonUasLogoff replied async\n"));
1021 : }
1022 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1023 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonUasLogoff, NDR_OUT | NDR_SET_VALUES, r2);
1024 : }
1025 0 : if (dce_call->fault_code != 0) {
1026 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonUasLogoff\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1027 : }
1028 0 : break;
1029 : }
1030 384 : case 2: { /* netr_LogonSamLogon */
1031 384 : struct netr_LogonSamLogon *r2 = (struct netr_LogonSamLogon *)r;
1032 384 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1033 0 : DEBUG(5,("function netr_LogonSamLogon replied async\n"));
1034 : }
1035 384 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1036 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogon, NDR_OUT | NDR_SET_VALUES, r2);
1037 : }
1038 384 : if (dce_call->fault_code != 0) {
1039 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonSamLogon\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1040 : }
1041 384 : break;
1042 : }
1043 0 : case 3: { /* netr_LogonSamLogoff */
1044 0 : struct netr_LogonSamLogoff *r2 = (struct netr_LogonSamLogoff *)r;
1045 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1046 0 : DEBUG(5,("function netr_LogonSamLogoff replied async\n"));
1047 : }
1048 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1049 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogoff, NDR_OUT | NDR_SET_VALUES, r2);
1050 : }
1051 0 : if (dce_call->fault_code != 0) {
1052 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonSamLogoff\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1053 : }
1054 0 : break;
1055 : }
1056 595 : case 4: { /* netr_ServerReqChallenge */
1057 595 : struct netr_ServerReqChallenge *r2 = (struct netr_ServerReqChallenge *)r;
1058 595 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1059 0 : DEBUG(5,("function netr_ServerReqChallenge replied async\n"));
1060 : }
1061 595 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1062 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerReqChallenge, NDR_OUT | NDR_SET_VALUES, r2);
1063 : }
1064 595 : if (dce_call->fault_code != 0) {
1065 0 : DBG_WARNING("dcerpc_fault %s in netr_ServerReqChallenge\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1066 : }
1067 595 : break;
1068 : }
1069 0 : case 5: { /* netr_ServerAuthenticate */
1070 0 : struct netr_ServerAuthenticate *r2 = (struct netr_ServerAuthenticate *)r;
1071 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1072 0 : DEBUG(5,("function netr_ServerAuthenticate replied async\n"));
1073 : }
1074 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1075 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate, NDR_OUT | NDR_SET_VALUES, r2);
1076 : }
1077 0 : if (dce_call->fault_code != 0) {
1078 0 : DBG_WARNING("dcerpc_fault %s in netr_ServerAuthenticate\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1079 : }
1080 0 : break;
1081 : }
1082 8 : case 6: { /* netr_ServerPasswordSet */
1083 8 : struct netr_ServerPasswordSet *r2 = (struct netr_ServerPasswordSet *)r;
1084 8 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1085 0 : DEBUG(5,("function netr_ServerPasswordSet replied async\n"));
1086 : }
1087 8 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1088 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordSet, NDR_OUT | NDR_SET_VALUES, r2);
1089 : }
1090 8 : if (dce_call->fault_code != 0) {
1091 0 : DBG_WARNING("dcerpc_fault %s in netr_ServerPasswordSet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1092 : }
1093 8 : break;
1094 : }
1095 0 : case 7: { /* netr_DatabaseDeltas */
1096 0 : struct netr_DatabaseDeltas *r2 = (struct netr_DatabaseDeltas *)r;
1097 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1098 0 : DEBUG(5,("function netr_DatabaseDeltas replied async\n"));
1099 : }
1100 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1101 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseDeltas, NDR_OUT | NDR_SET_VALUES, r2);
1102 : }
1103 0 : if (dce_call->fault_code != 0) {
1104 0 : DBG_WARNING("dcerpc_fault %s in netr_DatabaseDeltas\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1105 : }
1106 0 : break;
1107 : }
1108 0 : case 8: { /* netr_DatabaseSync */
1109 0 : struct netr_DatabaseSync *r2 = (struct netr_DatabaseSync *)r;
1110 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1111 0 : DEBUG(5,("function netr_DatabaseSync replied async\n"));
1112 : }
1113 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1114 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseSync, NDR_OUT | NDR_SET_VALUES, r2);
1115 : }
1116 0 : if (dce_call->fault_code != 0) {
1117 0 : DBG_WARNING("dcerpc_fault %s in netr_DatabaseSync\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1118 : }
1119 0 : break;
1120 : }
1121 0 : case 9: { /* netr_AccountDeltas */
1122 0 : struct netr_AccountDeltas *r2 = (struct netr_AccountDeltas *)r;
1123 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1124 0 : DEBUG(5,("function netr_AccountDeltas replied async\n"));
1125 : }
1126 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1127 0 : NDR_PRINT_FUNCTION_DEBUG(netr_AccountDeltas, NDR_OUT | NDR_SET_VALUES, r2);
1128 : }
1129 0 : if (dce_call->fault_code != 0) {
1130 0 : DBG_WARNING("dcerpc_fault %s in netr_AccountDeltas\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1131 : }
1132 0 : break;
1133 : }
1134 0 : case 10: { /* netr_AccountSync */
1135 0 : struct netr_AccountSync *r2 = (struct netr_AccountSync *)r;
1136 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1137 0 : DEBUG(5,("function netr_AccountSync replied async\n"));
1138 : }
1139 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1140 0 : NDR_PRINT_FUNCTION_DEBUG(netr_AccountSync, NDR_OUT | NDR_SET_VALUES, r2);
1141 : }
1142 0 : if (dce_call->fault_code != 0) {
1143 0 : DBG_WARNING("dcerpc_fault %s in netr_AccountSync\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1144 : }
1145 0 : break;
1146 : }
1147 0 : case 11: { /* netr_GetDcName */
1148 0 : struct netr_GetDcName *r2 = (struct netr_GetDcName *)r;
1149 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1150 0 : DEBUG(5,("function netr_GetDcName replied async\n"));
1151 : }
1152 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1153 0 : NDR_PRINT_FUNCTION_DEBUG(netr_GetDcName, NDR_OUT | NDR_SET_VALUES, r2);
1154 : }
1155 0 : if (dce_call->fault_code != 0) {
1156 0 : DBG_WARNING("dcerpc_fault %s in netr_GetDcName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1157 : }
1158 0 : break;
1159 : }
1160 260 : case 12: { /* netr_LogonControl */
1161 260 : struct netr_LogonControl *r2 = (struct netr_LogonControl *)r;
1162 260 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1163 0 : DEBUG(5,("function netr_LogonControl replied async\n"));
1164 : }
1165 260 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1166 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl, NDR_OUT | NDR_SET_VALUES, r2);
1167 : }
1168 260 : if (dce_call->fault_code != 0) {
1169 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonControl\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1170 : }
1171 260 : break;
1172 : }
1173 0 : case 13: { /* netr_GetAnyDCName */
1174 0 : struct netr_GetAnyDCName *r2 = (struct netr_GetAnyDCName *)r;
1175 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1176 0 : DEBUG(5,("function netr_GetAnyDCName replied async\n"));
1177 : }
1178 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1179 0 : NDR_PRINT_FUNCTION_DEBUG(netr_GetAnyDCName, NDR_OUT | NDR_SET_VALUES, r2);
1180 : }
1181 0 : if (dce_call->fault_code != 0) {
1182 0 : DBG_WARNING("dcerpc_fault %s in netr_GetAnyDCName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1183 : }
1184 0 : break;
1185 : }
1186 56 : case 14: { /* netr_LogonControl2 */
1187 56 : struct netr_LogonControl2 *r2 = (struct netr_LogonControl2 *)r;
1188 56 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1189 0 : DEBUG(5,("function netr_LogonControl2 replied async\n"));
1190 : }
1191 56 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1192 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl2, NDR_OUT | NDR_SET_VALUES, r2);
1193 : }
1194 56 : if (dce_call->fault_code != 0) {
1195 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonControl2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1196 : }
1197 56 : break;
1198 : }
1199 42 : case 15: { /* netr_ServerAuthenticate2 */
1200 42 : struct netr_ServerAuthenticate2 *r2 = (struct netr_ServerAuthenticate2 *)r;
1201 42 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1202 0 : DEBUG(5,("function netr_ServerAuthenticate2 replied async\n"));
1203 : }
1204 42 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1205 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate2, NDR_OUT | NDR_SET_VALUES, r2);
1206 : }
1207 42 : if (dce_call->fault_code != 0) {
1208 0 : DBG_WARNING("dcerpc_fault %s in netr_ServerAuthenticate2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1209 : }
1210 42 : break;
1211 : }
1212 0 : case 16: { /* netr_DatabaseSync2 */
1213 0 : struct netr_DatabaseSync2 *r2 = (struct netr_DatabaseSync2 *)r;
1214 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1215 0 : DEBUG(5,("function netr_DatabaseSync2 replied async\n"));
1216 : }
1217 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1218 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseSync2, NDR_OUT | NDR_SET_VALUES, r2);
1219 : }
1220 0 : if (dce_call->fault_code != 0) {
1221 0 : DBG_WARNING("dcerpc_fault %s in netr_DatabaseSync2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1222 : }
1223 0 : break;
1224 : }
1225 0 : case 17: { /* netr_DatabaseRedo */
1226 0 : struct netr_DatabaseRedo *r2 = (struct netr_DatabaseRedo *)r;
1227 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1228 0 : DEBUG(5,("function netr_DatabaseRedo replied async\n"));
1229 : }
1230 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1231 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DatabaseRedo, NDR_OUT | NDR_SET_VALUES, r2);
1232 : }
1233 0 : if (dce_call->fault_code != 0) {
1234 0 : DBG_WARNING("dcerpc_fault %s in netr_DatabaseRedo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1235 : }
1236 0 : break;
1237 : }
1238 56 : case 18: { /* netr_LogonControl2Ex */
1239 56 : struct netr_LogonControl2Ex *r2 = (struct netr_LogonControl2Ex *)r;
1240 56 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1241 0 : DEBUG(5,("function netr_LogonControl2Ex replied async\n"));
1242 : }
1243 56 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1244 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonControl2Ex, NDR_OUT | NDR_SET_VALUES, r2);
1245 : }
1246 56 : if (dce_call->fault_code != 0) {
1247 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonControl2Ex\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1248 : }
1249 56 : break;
1250 : }
1251 0 : case 19: { /* netr_NetrEnumerateTrustedDomains */
1252 0 : struct netr_NetrEnumerateTrustedDomains *r2 = (struct netr_NetrEnumerateTrustedDomains *)r;
1253 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1254 0 : DEBUG(5,("function netr_NetrEnumerateTrustedDomains replied async\n"));
1255 : }
1256 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1257 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NetrEnumerateTrustedDomains, NDR_OUT | NDR_SET_VALUES, r2);
1258 : }
1259 0 : if (dce_call->fault_code != 0) {
1260 0 : DBG_WARNING("dcerpc_fault %s in netr_NetrEnumerateTrustedDomains\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1261 : }
1262 0 : break;
1263 : }
1264 0 : case 20: { /* netr_DsRGetDCName */
1265 0 : struct netr_DsRGetDCName *r2 = (struct netr_DsRGetDCName *)r;
1266 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1267 0 : DEBUG(5,("function netr_DsRGetDCName replied async\n"));
1268 : }
1269 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1270 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCName, NDR_OUT | NDR_SET_VALUES, r2);
1271 : }
1272 0 : if (dce_call->fault_code != 0) {
1273 0 : DBG_WARNING("dcerpc_fault %s in netr_DsRGetDCName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1274 : }
1275 0 : break;
1276 : }
1277 33 : case 21: { /* netr_LogonGetCapabilities */
1278 33 : struct netr_LogonGetCapabilities *r2 = (struct netr_LogonGetCapabilities *)r;
1279 33 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1280 0 : DEBUG(5,("function netr_LogonGetCapabilities replied async\n"));
1281 : }
1282 33 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1283 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetCapabilities, NDR_OUT | NDR_SET_VALUES, r2);
1284 : }
1285 33 : if (dce_call->fault_code != 0) {
1286 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonGetCapabilities\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1287 : }
1288 33 : break;
1289 : }
1290 0 : case 22: { /* netr_NETRLOGONSETSERVICEBITS */
1291 0 : struct netr_NETRLOGONSETSERVICEBITS *r2 = (struct netr_NETRLOGONSETSERVICEBITS *)r;
1292 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1293 0 : DEBUG(5,("function netr_NETRLOGONSETSERVICEBITS replied async\n"));
1294 : }
1295 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1296 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONSETSERVICEBITS, NDR_OUT | NDR_SET_VALUES, r2);
1297 : }
1298 0 : if (dce_call->fault_code != 0) {
1299 0 : DBG_WARNING("dcerpc_fault %s in netr_NETRLOGONSETSERVICEBITS\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1300 : }
1301 0 : break;
1302 : }
1303 0 : case 23: { /* netr_LogonGetTrustRid */
1304 0 : struct netr_LogonGetTrustRid *r2 = (struct netr_LogonGetTrustRid *)r;
1305 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1306 0 : DEBUG(5,("function netr_LogonGetTrustRid replied async\n"));
1307 : }
1308 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1309 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetTrustRid, NDR_OUT | NDR_SET_VALUES, r2);
1310 : }
1311 0 : if (dce_call->fault_code != 0) {
1312 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonGetTrustRid\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1313 : }
1314 0 : break;
1315 : }
1316 0 : case 24: { /* netr_NETRLOGONCOMPUTESERVERDIGEST */
1317 0 : struct netr_NETRLOGONCOMPUTESERVERDIGEST *r2 = (struct netr_NETRLOGONCOMPUTESERVERDIGEST *)r;
1318 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1319 0 : DEBUG(5,("function netr_NETRLOGONCOMPUTESERVERDIGEST replied async\n"));
1320 : }
1321 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1322 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, NDR_OUT | NDR_SET_VALUES, r2);
1323 : }
1324 0 : if (dce_call->fault_code != 0) {
1325 0 : DBG_WARNING("dcerpc_fault %s in netr_NETRLOGONCOMPUTESERVERDIGEST\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1326 : }
1327 0 : break;
1328 : }
1329 0 : case 25: { /* netr_NETRLOGONCOMPUTECLIENTDIGEST */
1330 0 : struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r2 = (struct netr_NETRLOGONCOMPUTECLIENTDIGEST *)r;
1331 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1332 0 : DEBUG(5,("function netr_NETRLOGONCOMPUTECLIENTDIGEST replied async\n"));
1333 : }
1334 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1335 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, NDR_OUT | NDR_SET_VALUES, r2);
1336 : }
1337 0 : if (dce_call->fault_code != 0) {
1338 0 : DBG_WARNING("dcerpc_fault %s in netr_NETRLOGONCOMPUTECLIENTDIGEST\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1339 : }
1340 0 : break;
1341 : }
1342 8 : case 26: { /* netr_ServerAuthenticate3 */
1343 8 : struct netr_ServerAuthenticate3 *r2 = (struct netr_ServerAuthenticate3 *)r;
1344 8 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1345 0 : DEBUG(5,("function netr_ServerAuthenticate3 replied async\n"));
1346 : }
1347 8 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1348 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerAuthenticate3, NDR_OUT | NDR_SET_VALUES, r2);
1349 : }
1350 8 : if (dce_call->fault_code != 0) {
1351 0 : DBG_WARNING("dcerpc_fault %s in netr_ServerAuthenticate3\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1352 : }
1353 8 : break;
1354 : }
1355 0 : case 27: { /* netr_DsRGetDCNameEx */
1356 0 : struct netr_DsRGetDCNameEx *r2 = (struct netr_DsRGetDCNameEx *)r;
1357 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1358 0 : DEBUG(5,("function netr_DsRGetDCNameEx replied async\n"));
1359 : }
1360 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1361 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCNameEx, NDR_OUT | NDR_SET_VALUES, r2);
1362 : }
1363 0 : if (dce_call->fault_code != 0) {
1364 0 : DBG_WARNING("dcerpc_fault %s in netr_DsRGetDCNameEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1365 : }
1366 0 : break;
1367 : }
1368 0 : case 28: { /* netr_DsRGetSiteName */
1369 0 : struct netr_DsRGetSiteName *r2 = (struct netr_DsRGetSiteName *)r;
1370 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1371 0 : DEBUG(5,("function netr_DsRGetSiteName replied async\n"));
1372 : }
1373 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1374 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetSiteName, NDR_OUT | NDR_SET_VALUES, r2);
1375 : }
1376 0 : if (dce_call->fault_code != 0) {
1377 0 : DBG_WARNING("dcerpc_fault %s in netr_DsRGetSiteName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1378 : }
1379 0 : break;
1380 : }
1381 0 : case 29: { /* netr_LogonGetDomainInfo */
1382 0 : struct netr_LogonGetDomainInfo *r2 = (struct netr_LogonGetDomainInfo *)r;
1383 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1384 0 : DEBUG(5,("function netr_LogonGetDomainInfo replied async\n"));
1385 : }
1386 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1387 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonGetDomainInfo, NDR_OUT | NDR_SET_VALUES, r2);
1388 : }
1389 0 : if (dce_call->fault_code != 0) {
1390 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonGetDomainInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1391 : }
1392 0 : break;
1393 : }
1394 8 : case 30: { /* netr_ServerPasswordSet2 */
1395 8 : struct netr_ServerPasswordSet2 *r2 = (struct netr_ServerPasswordSet2 *)r;
1396 8 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1397 0 : DEBUG(5,("function netr_ServerPasswordSet2 replied async\n"));
1398 : }
1399 8 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1400 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordSet2, NDR_OUT | NDR_SET_VALUES, r2);
1401 : }
1402 8 : if (dce_call->fault_code != 0) {
1403 0 : DBG_WARNING("dcerpc_fault %s in netr_ServerPasswordSet2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1404 : }
1405 8 : break;
1406 : }
1407 0 : case 31: { /* netr_ServerPasswordGet */
1408 0 : struct netr_ServerPasswordGet *r2 = (struct netr_ServerPasswordGet *)r;
1409 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1410 0 : DEBUG(5,("function netr_ServerPasswordGet replied async\n"));
1411 : }
1412 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1413 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerPasswordGet, NDR_OUT | NDR_SET_VALUES, r2);
1414 : }
1415 0 : if (dce_call->fault_code != 0) {
1416 0 : DBG_WARNING("dcerpc_fault %s in netr_ServerPasswordGet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1417 : }
1418 0 : break;
1419 : }
1420 0 : case 32: { /* netr_NetrLogonSendToSam */
1421 0 : struct netr_NetrLogonSendToSam *r2 = (struct netr_NetrLogonSendToSam *)r;
1422 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1423 0 : DEBUG(5,("function netr_NetrLogonSendToSam replied async\n"));
1424 : }
1425 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1426 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NetrLogonSendToSam, NDR_OUT | NDR_SET_VALUES, r2);
1427 : }
1428 0 : if (dce_call->fault_code != 0) {
1429 0 : DBG_WARNING("dcerpc_fault %s in netr_NetrLogonSendToSam\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1430 : }
1431 0 : break;
1432 : }
1433 0 : case 33: { /* netr_DsRAddressToSitenamesW */
1434 0 : struct netr_DsRAddressToSitenamesW *r2 = (struct netr_DsRAddressToSitenamesW *)r;
1435 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1436 0 : DEBUG(5,("function netr_DsRAddressToSitenamesW replied async\n"));
1437 : }
1438 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1439 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRAddressToSitenamesW, NDR_OUT | NDR_SET_VALUES, r2);
1440 : }
1441 0 : if (dce_call->fault_code != 0) {
1442 0 : DBG_WARNING("dcerpc_fault %s in netr_DsRAddressToSitenamesW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1443 : }
1444 0 : break;
1445 : }
1446 0 : case 34: { /* netr_DsRGetDCNameEx2 */
1447 0 : struct netr_DsRGetDCNameEx2 *r2 = (struct netr_DsRGetDCNameEx2 *)r;
1448 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1449 0 : DEBUG(5,("function netr_DsRGetDCNameEx2 replied async\n"));
1450 : }
1451 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1452 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetDCNameEx2, NDR_OUT | NDR_SET_VALUES, r2);
1453 : }
1454 0 : if (dce_call->fault_code != 0) {
1455 0 : DBG_WARNING("dcerpc_fault %s in netr_DsRGetDCNameEx2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1456 : }
1457 0 : break;
1458 : }
1459 0 : case 35: { /* netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN */
1460 0 : struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r2 = (struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *)r;
1461 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1462 0 : DEBUG(5,("function netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN replied async\n"));
1463 : }
1464 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1465 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, NDR_OUT | NDR_SET_VALUES, r2);
1466 : }
1467 0 : if (dce_call->fault_code != 0) {
1468 0 : DBG_WARNING("dcerpc_fault %s in netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1469 : }
1470 0 : break;
1471 : }
1472 0 : case 36: { /* netr_NetrEnumerateTrustedDomainsEx */
1473 0 : struct netr_NetrEnumerateTrustedDomainsEx *r2 = (struct netr_NetrEnumerateTrustedDomainsEx *)r;
1474 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1475 0 : DEBUG(5,("function netr_NetrEnumerateTrustedDomainsEx replied async\n"));
1476 : }
1477 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1478 0 : NDR_PRINT_FUNCTION_DEBUG(netr_NetrEnumerateTrustedDomainsEx, NDR_OUT | NDR_SET_VALUES, r2);
1479 : }
1480 0 : if (dce_call->fault_code != 0) {
1481 0 : DBG_WARNING("dcerpc_fault %s in netr_NetrEnumerateTrustedDomainsEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1482 : }
1483 0 : break;
1484 : }
1485 0 : case 37: { /* netr_DsRAddressToSitenamesExW */
1486 0 : struct netr_DsRAddressToSitenamesExW *r2 = (struct netr_DsRAddressToSitenamesExW *)r;
1487 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1488 0 : DEBUG(5,("function netr_DsRAddressToSitenamesExW replied async\n"));
1489 : }
1490 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1491 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRAddressToSitenamesExW, NDR_OUT | NDR_SET_VALUES, r2);
1492 : }
1493 0 : if (dce_call->fault_code != 0) {
1494 0 : DBG_WARNING("dcerpc_fault %s in netr_DsRAddressToSitenamesExW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1495 : }
1496 0 : break;
1497 : }
1498 0 : case 38: { /* netr_DsrGetDcSiteCoverageW */
1499 0 : struct netr_DsrGetDcSiteCoverageW *r2 = (struct netr_DsrGetDcSiteCoverageW *)r;
1500 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1501 0 : DEBUG(5,("function netr_DsrGetDcSiteCoverageW replied async\n"));
1502 : }
1503 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1504 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsrGetDcSiteCoverageW, NDR_OUT | NDR_SET_VALUES, r2);
1505 : }
1506 0 : if (dce_call->fault_code != 0) {
1507 0 : DBG_WARNING("dcerpc_fault %s in netr_DsrGetDcSiteCoverageW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1508 : }
1509 0 : break;
1510 : }
1511 639 : case 39: { /* netr_LogonSamLogonEx */
1512 639 : struct netr_LogonSamLogonEx *r2 = (struct netr_LogonSamLogonEx *)r;
1513 639 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1514 0 : DEBUG(5,("function netr_LogonSamLogonEx replied async\n"));
1515 : }
1516 639 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1517 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogonEx, NDR_OUT | NDR_SET_VALUES, r2);
1518 : }
1519 639 : if (dce_call->fault_code != 0) {
1520 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonSamLogonEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1521 : }
1522 639 : break;
1523 : }
1524 0 : case 40: { /* netr_DsrEnumerateDomainTrusts */
1525 0 : struct netr_DsrEnumerateDomainTrusts *r2 = (struct netr_DsrEnumerateDomainTrusts *)r;
1526 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1527 0 : DEBUG(5,("function netr_DsrEnumerateDomainTrusts replied async\n"));
1528 : }
1529 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1530 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsrEnumerateDomainTrusts, NDR_OUT | NDR_SET_VALUES, r2);
1531 : }
1532 0 : if (dce_call->fault_code != 0) {
1533 0 : DBG_WARNING("dcerpc_fault %s in netr_DsrEnumerateDomainTrusts\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1534 : }
1535 0 : break;
1536 : }
1537 0 : case 41: { /* netr_DsrDeregisterDNSHostRecords */
1538 0 : struct netr_DsrDeregisterDNSHostRecords *r2 = (struct netr_DsrDeregisterDNSHostRecords *)r;
1539 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1540 0 : DEBUG(5,("function netr_DsrDeregisterDNSHostRecords replied async\n"));
1541 : }
1542 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1543 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsrDeregisterDNSHostRecords, NDR_OUT | NDR_SET_VALUES, r2);
1544 : }
1545 0 : if (dce_call->fault_code != 0) {
1546 0 : DBG_WARNING("dcerpc_fault %s in netr_DsrDeregisterDNSHostRecords\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1547 : }
1548 0 : break;
1549 : }
1550 0 : case 42: { /* netr_ServerTrustPasswordsGet */
1551 0 : struct netr_ServerTrustPasswordsGet *r2 = (struct netr_ServerTrustPasswordsGet *)r;
1552 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1553 0 : DEBUG(5,("function netr_ServerTrustPasswordsGet replied async\n"));
1554 : }
1555 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1556 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerTrustPasswordsGet, NDR_OUT | NDR_SET_VALUES, r2);
1557 : }
1558 0 : if (dce_call->fault_code != 0) {
1559 0 : DBG_WARNING("dcerpc_fault %s in netr_ServerTrustPasswordsGet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1560 : }
1561 0 : break;
1562 : }
1563 0 : case 43: { /* netr_DsRGetForestTrustInformation */
1564 0 : struct netr_DsRGetForestTrustInformation *r2 = (struct netr_DsRGetForestTrustInformation *)r;
1565 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1566 0 : DEBUG(5,("function netr_DsRGetForestTrustInformation replied async\n"));
1567 : }
1568 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1569 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsRGetForestTrustInformation, NDR_OUT | NDR_SET_VALUES, r2);
1570 : }
1571 0 : if (dce_call->fault_code != 0) {
1572 0 : DBG_WARNING("dcerpc_fault %s in netr_DsRGetForestTrustInformation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1573 : }
1574 0 : break;
1575 : }
1576 0 : case 44: { /* netr_GetForestTrustInformation */
1577 0 : struct netr_GetForestTrustInformation *r2 = (struct netr_GetForestTrustInformation *)r;
1578 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1579 0 : DEBUG(5,("function netr_GetForestTrustInformation replied async\n"));
1580 : }
1581 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1582 0 : NDR_PRINT_FUNCTION_DEBUG(netr_GetForestTrustInformation, NDR_OUT | NDR_SET_VALUES, r2);
1583 : }
1584 0 : if (dce_call->fault_code != 0) {
1585 0 : DBG_WARNING("dcerpc_fault %s in netr_GetForestTrustInformation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1586 : }
1587 0 : break;
1588 : }
1589 0 : case 45: { /* netr_LogonSamLogonWithFlags */
1590 0 : struct netr_LogonSamLogonWithFlags *r2 = (struct netr_LogonSamLogonWithFlags *)r;
1591 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1592 0 : DEBUG(5,("function netr_LogonSamLogonWithFlags replied async\n"));
1593 : }
1594 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1595 0 : NDR_PRINT_FUNCTION_DEBUG(netr_LogonSamLogonWithFlags, NDR_OUT | NDR_SET_VALUES, r2);
1596 : }
1597 0 : if (dce_call->fault_code != 0) {
1598 0 : DBG_WARNING("dcerpc_fault %s in netr_LogonSamLogonWithFlags\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1599 : }
1600 0 : break;
1601 : }
1602 0 : case 46: { /* netr_ServerGetTrustInfo */
1603 0 : struct netr_ServerGetTrustInfo *r2 = (struct netr_ServerGetTrustInfo *)r;
1604 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1605 0 : DEBUG(5,("function netr_ServerGetTrustInfo replied async\n"));
1606 : }
1607 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1608 0 : NDR_PRINT_FUNCTION_DEBUG(netr_ServerGetTrustInfo, NDR_OUT | NDR_SET_VALUES, r2);
1609 : }
1610 0 : if (dce_call->fault_code != 0) {
1611 0 : DBG_WARNING("dcerpc_fault %s in netr_ServerGetTrustInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1612 : }
1613 0 : break;
1614 : }
1615 0 : case 47: { /* netr_Unused47 */
1616 0 : struct netr_Unused47 *r2 = (struct netr_Unused47 *)r;
1617 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1618 0 : DEBUG(5,("function netr_Unused47 replied async\n"));
1619 : }
1620 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1621 0 : NDR_PRINT_FUNCTION_DEBUG(netr_Unused47, NDR_OUT | NDR_SET_VALUES, r2);
1622 : }
1623 0 : if (dce_call->fault_code != 0) {
1624 0 : DBG_WARNING("dcerpc_fault %s in netr_Unused47\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1625 : }
1626 0 : break;
1627 : }
1628 0 : case 48: { /* netr_DsrUpdateReadOnlyServerDnsRecords */
1629 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *r2 = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)r;
1630 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1631 0 : DEBUG(5,("function netr_DsrUpdateReadOnlyServerDnsRecords replied async\n"));
1632 : }
1633 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1634 0 : NDR_PRINT_FUNCTION_DEBUG(netr_DsrUpdateReadOnlyServerDnsRecords, NDR_OUT | NDR_SET_VALUES, r2);
1635 : }
1636 0 : if (dce_call->fault_code != 0) {
1637 0 : DBG_WARNING("dcerpc_fault %s in netr_DsrUpdateReadOnlyServerDnsRecords\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1638 : }
1639 0 : break;
1640 : }
1641 0 : default:
1642 0 : dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
1643 0 : break;
1644 : }
1645 :
1646 2089 : if (dce_call->fault_code != 0) {
1647 0 : return NT_STATUS_NET_WRITE_FAULT;
1648 : }
1649 :
1650 2089 : return NT_STATUS_OK;
1651 : }
1652 :
1653 2089 : NTSTATUS netlogon__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
1654 : {
1655 : enum ndr_err_code ndr_err;
1656 2089 : uint16_t opnum = dce_call->pkt.u.request.opnum;
1657 :
1658 2089 : ndr_err = ndr_table_netlogon.calls[opnum].ndr_push(push, NDR_OUT, r);
1659 2089 : if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1660 0 : dce_call->fault_code = DCERPC_FAULT_NDR;
1661 0 : return NT_STATUS_NET_WRITE_FAULT;
1662 : }
1663 :
1664 2089 : return NT_STATUS_OK;
1665 : }
1666 :
1667 0 : NTSTATUS netlogon__op_local(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
1668 : {
1669 0 : return netlogon__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_INTERNAL);
1670 : }
1671 :
1672 : static const struct dcesrv_interface dcesrv_netlogon_interface = {
1673 : .name = "netlogon",
1674 : .syntax_id = {{0x12345678,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0xcf,0xfb}},1.0},
1675 : .bind = netlogon__op_bind,
1676 : .unbind = netlogon__op_unbind,
1677 : .ndr_pull = netlogon__op_ndr_pull,
1678 : .dispatch = netlogon__op_dispatch,
1679 : .reply = netlogon__op_reply,
1680 : .ndr_push = netlogon__op_ndr_push,
1681 : .local = netlogon__op_local,
1682 : #ifdef DCESRV_INTERFACE_NETLOGON_FLAGS
1683 : .flags = DCESRV_INTERFACE_NETLOGON_FLAGS
1684 : #else
1685 : .flags = 0
1686 : #endif
1687 : };
1688 :
1689 27 : static NTSTATUS netlogon__check_register_in_endpoint(const char *name, struct dcerpc_binding *binding) {
1690 27 : enum dcerpc_transport_t transport = dcerpc_binding_get_transport(binding);
1691 : NTSTATUS status;
1692 :
1693 : /* If service is disabled, do not register */
1694 27 : if (rpc_service_mode(name) == RPC_SERVICE_MODE_DISABLED) {
1695 3 : return NT_STATUS_NOT_IMPLEMENTED;
1696 : }
1697 :
1698 : /* If service is embedded, register only for ncacn_np
1699 : * see 8466b3c85e4b835e57e41776853093f4a0edc8b8
1700 : */
1701 24 : if (rpc_service_mode(name) == RPC_SERVICE_MODE_EMBEDDED && (transport != NCACN_NP && transport != NCALRPC)) {
1702 0 : DBG_INFO("Interface 'netlogon' not registered in endpoint '%s' as service is embedded\n", name);
1703 0 : return NT_STATUS_NOT_SUPPORTED;
1704 : }
1705 :
1706 : /*
1707 : * If rpc service is external then change the default ncalrpc endpoint,
1708 : * otherwise if the rpc daemon running this service is configured in
1709 : * fork mode the forked process will race with main smbd to accept the
1710 : * connections in the default ncalrpc socket, and the forked process
1711 : * may not have the requested interface registered.
1712 : * For example, in the ad_member test environment:
1713 : *
1714 : * rpc_server:lsarpc = external
1715 : * rpc_server:samr = external
1716 : * rpc_server:netlogon = disabled
1717 : * rpc_daemon:lsasd = fork
1718 : *
1719 : * With these settings both, the main smbd and all the preforked lsasd
1720 : * processes would be listening in the default ncalrpc socket if it is
1721 : * not changed. If a client connection is accepted by one of the lsasd
1722 : * worker processes and the client asks for an interface not registered
1723 : * in these processes (winreg for example) it will get an error.
1724 : */
1725 24 : if (rpc_service_mode(name) == RPC_SERVICE_MODE_EXTERNAL && transport == NCALRPC) {
1726 8 : status = dcerpc_binding_set_string_option(binding, "endpoint", "NETLOGON");
1727 8 : if (!NT_STATUS_IS_OK(status)) {
1728 0 : return status;
1729 : }
1730 : }
1731 :
1732 24 : return NT_STATUS_OK;
1733 : }
1734 :
1735 9 : static NTSTATUS netlogon__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
1736 : {
1737 : uint32_t i;
1738 : NTSTATUS ret;
1739 : struct dcerpc_binding *binding;
1740 9 : struct dcerpc_binding *binding2 = NULL;
1741 :
1742 : #ifdef DCESRV_INTERFACE_NETLOGON_NCACN_NP_SECONDARY_ENDPOINT
1743 : const char *ncacn_np_secondary_endpoint = DCESRV_INTERFACE_NETLOGON_NCACN_NP_SECONDARY_ENDPOINT;
1744 : #else
1745 9 : const char *ncacn_np_secondary_endpoint = NULL;
1746 : #endif
1747 :
1748 36 : for (i=0;i<ndr_table_netlogon.endpoints->count;i++) {
1749 27 : const char *name = ndr_table_netlogon.endpoints->names[i];
1750 :
1751 27 : ret = dcerpc_parse_binding(dce_ctx, name, &binding);
1752 27 : if (NT_STATUS_IS_ERR(ret)) {
1753 0 : DBG_ERR("Failed to parse binding string '%s'\n", name);
1754 0 : return ret;
1755 : }
1756 :
1757 27 : ret = netlogon__check_register_in_endpoint("netlogon", binding);
1758 27 : if (NT_STATUS_IS_ERR(ret)) {
1759 3 : talloc_free(binding);
1760 3 : continue;
1761 : }
1762 :
1763 24 : if (ncacn_np_secondary_endpoint != NULL) {
1764 0 : ret = dcerpc_parse_binding(dce_ctx, ncacn_np_secondary_endpoint, &binding2);
1765 0 : if (NT_STATUS_IS_ERR(ret)) {
1766 0 : DBG_ERR("Failed to parse 2nd binding string '%s'\n", ncacn_np_secondary_endpoint);
1767 0 : TALLOC_FREE(binding);
1768 0 : return ret;
1769 : }
1770 : }
1771 :
1772 24 : ret = dcesrv_interface_register_b(dce_ctx, binding, binding2, &dcesrv_netlogon_interface, NULL);
1773 24 : TALLOC_FREE(binding);
1774 24 : TALLOC_FREE(binding2);
1775 24 : if (!NT_STATUS_IS_OK(ret)) {
1776 0 : DBG_ERR("Failed to register endpoint '%s'\n",name);
1777 0 : return ret;
1778 : }
1779 : }
1780 :
1781 9 : return NT_STATUS_OK;
1782 : }
1783 :
1784 0 : static NTSTATUS netlogon__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
1785 : {
1786 0 : return NT_STATUS_OK;
1787 : }
1788 :
1789 0 : static bool netlogon__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
1790 : {
1791 0 : if (dcesrv_netlogon_interface.syntax_id.if_version == if_version && GUID_equal(&dcesrv_netlogon_interface.syntax_id.uuid, uuid)) {
1792 0 : memcpy(iface,&dcesrv_netlogon_interface, sizeof(*iface));
1793 0 : return true;
1794 : }
1795 :
1796 0 : return false;
1797 : }
1798 :
1799 0 : static bool netlogon__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
1800 : {
1801 0 : if (strcmp(dcesrv_netlogon_interface.name, name)==0) {
1802 0 : memcpy(iface, &dcesrv_netlogon_interface, sizeof(*iface));
1803 0 : return true;
1804 : }
1805 :
1806 0 : return false;
1807 : }
1808 :
1809 : static const struct dcesrv_endpoint_server netlogon_ep_server = {
1810 : /* fill in our name */
1811 : .name = "netlogon",
1812 :
1813 : /* Initialization flag */
1814 : .initialized = false,
1815 :
1816 : /* fill in all the operations */
1817 : #ifdef DCESRV_INTERFACE_NETLOGON_INIT_SERVER
1818 : .init_server = DCESRV_INTERFACE_NETLOGON_INIT_SERVER,
1819 : #else
1820 : .init_server = netlogon__op_init_server,
1821 : #endif
1822 : #ifdef DCESRV_INTERFACE_NETLOGON_SHUTDOWN_SERVER
1823 : .shutdown_server = DCESRV_INTERFACE_NETLOGON_SHUTDOWN_SERVER,
1824 : #else
1825 : .shutdown_server = netlogon__op_shutdown_server,
1826 : #endif
1827 : .interface_by_uuid = netlogon__op_interface_by_uuid,
1828 : .interface_by_name = netlogon__op_interface_by_name
1829 : };
1830 :
1831 69 : const struct dcesrv_endpoint_server *netlogon_get_ep_server(void)
1832 : {
1833 69 : return &netlogon_ep_server;
1834 : }
|