r3837: added support for LsaLookupSids in the LSA rpc server. This allows the GUI...
[jelmer/samba4-debian.git] / source / rpc_server / lsa / dcesrv_lsa.c
1 /* 
2    Unix SMB/CIFS implementation.
3
4    endpoint server for the lsarpc pipe
5
6    Copyright (C) Andrew Tridgell 2004
7    
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12    
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23 #include "includes.h"
24 #include "librpc/gen_ndr/ndr_lsa.h"
25 #include "librpc/gen_ndr/ndr_samr.h"
26 #include "rpc_server/dcerpc_server.h"
27 #include "rpc_server/common/common.h"
28 #include "lib/ldb/include/ldb.h"
29
30 /*
31   this type allows us to distinguish handle types
32 */
33 enum lsa_handle {
34         LSA_HANDLE_POLICY,
35         LSA_HANDLE_ACCOUNT,
36         LSA_HANDLE_SECRET
37 };
38
39 /*
40   state associated with a lsa_OpenPolicy() operation
41 */
42 struct lsa_policy_state {
43         int reference_count;
44         void *sam_ctx;
45         uint32_t access_mask;
46         const char *domain_dn;
47 };
48
49
50 /*
51   destroy policy state
52 */
53 static void lsa_Policy_close(struct lsa_policy_state *state)
54 {
55         state->reference_count--;
56         if (state->reference_count == 0) {
57                 talloc_free(state);
58         }
59 }
60
61 /*
62   destroy an open policy. This closes the database connection
63 */
64 static void lsa_Policy_destroy(struct dcesrv_connection *conn, struct dcesrv_handle *h)
65 {
66         struct lsa_policy_state *state = h->data;
67         lsa_Policy_close(state);
68 }
69
70 /* 
71   lsa_Close 
72 */
73 static NTSTATUS lsa_Close(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
74                           struct lsa_Close *r)
75 {
76         struct dcesrv_handle *h;
77
78         *r->out.handle = *r->in.handle;
79
80         DCESRV_PULL_HANDLE(h, r->in.handle, DCESRV_HANDLE_ANY);
81
82         /* this causes the callback samr_XXX_destroy() to be called by
83            the handle destroy code which destroys the state associated
84            with the handle */
85         dcesrv_handle_destroy(dce_call->conn, h);
86
87         ZERO_STRUCTP(r->out.handle);
88
89         return NT_STATUS_OK;
90 }
91
92
93 /* 
94   lsa_Delete 
95 */
96 static NTSTATUS lsa_Delete(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
97                            struct lsa_Delete *r)
98 {
99         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
100 }
101
102
103 /* 
104   lsa_EnumPrivs 
105 */
106 static NTSTATUS lsa_EnumPrivs(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
107                               struct lsa_EnumPrivs *r)
108 {
109         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
110 }
111
112
113 /* 
114   lsa_QuerySecObj 
115 */
116 static NTSTATUS lsa_QuerySecObj(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
117                                 struct lsa_QuerySecObj *r)
118 {
119         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
120 }
121
122
123 /* 
124   lsa_SetSecObj 
125 */
126 static NTSTATUS lsa_SetSecObj(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
127                               struct lsa_SetSecObj *r)
128 {
129         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
130 }
131
132
133 /* 
134   lsa_ChangePassword 
135 */
136 static NTSTATUS lsa_ChangePassword(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
137                                    struct lsa_ChangePassword *r)
138 {
139         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
140 }
141
142
143 /* 
144   lsa_OpenPolicy2
145 */
146 static NTSTATUS lsa_OpenPolicy2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
147                                struct lsa_OpenPolicy2 *r)
148 {
149         struct lsa_policy_state *state;
150         struct dcesrv_handle *handle;
151
152         ZERO_STRUCTP(r->out.handle);
153
154         state = talloc_p(dce_call->conn, struct lsa_policy_state);
155         if (!state) {
156                 return NT_STATUS_NO_MEMORY;
157         }
158
159         /* make sure the sam database is accessible */
160         state->sam_ctx = samdb_connect(state);
161         if (state->sam_ctx == NULL) {
162                 talloc_free(state);
163                 return NT_STATUS_INVALID_SYSTEM_SERVICE;
164         }
165
166         /* work out the domain_dn - useful for so many calls its worth
167            fetching here */
168         state->domain_dn = samdb_search_string(state->sam_ctx, state, NULL,
169                                                "dn", "(&(objectClass=domain)(!(objectclass=builtinDomain)))");
170         if (!state->domain_dn) {
171                 talloc_free(state);
172                 return NT_STATUS_NO_SUCH_DOMAIN;                
173         }
174
175         handle = dcesrv_handle_new(dce_call->conn, LSA_HANDLE_POLICY);
176         if (!handle) {
177                 talloc_free(state);
178                 return NT_STATUS_NO_MEMORY;
179         }
180
181         handle->data = state;
182         handle->destroy = lsa_Policy_destroy;
183
184         state->reference_count = 1;
185         state->access_mask = r->in.access_mask;
186         *r->out.handle = handle->wire_handle;
187
188         /* note that we have completely ignored the attr element of
189            the OpenPolicy. As far as I can tell, this is what w2k3
190            does */
191
192         return NT_STATUS_OK;
193 }
194
195 /* 
196   lsa_OpenPolicy
197   a wrapper around lsa_OpenPolicy2
198 */
199 static NTSTATUS lsa_OpenPolicy(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
200                                 struct lsa_OpenPolicy *r)
201 {
202         struct lsa_OpenPolicy2 r2;
203
204         r2.in.system_name = NULL;
205         r2.in.attr = r->in.attr;
206         r2.in.access_mask = r->in.access_mask;
207         r2.out.handle = r->out.handle;
208
209         return lsa_OpenPolicy2(dce_call, mem_ctx, &r2);
210 }
211
212
213
214
215 /*
216   fill in the AccountDomain info
217 */
218 static NTSTATUS lsa_info_AccountDomain(struct lsa_policy_state *state, TALLOC_CTX *mem_ctx,
219                                        struct lsa_DomainInfo *info)
220 {
221         const char * const attrs[] = { "objectSid", "name", NULL};
222         int ret;
223         struct ldb_message **res;
224
225         ret = samdb_search(state->sam_ctx, mem_ctx, NULL, &res, attrs, 
226                            "dn=%s", state->domain_dn);
227         if (ret != 1) {
228                 return NT_STATUS_INTERNAL_DB_CORRUPTION;
229         }
230
231         info->name.name = samdb_result_string(res[0], "name", NULL);
232         info->sid       = samdb_result_dom_sid(mem_ctx, res[0], "objectSid");
233
234         return NT_STATUS_OK;
235 }
236
237 /*
238   fill in the DNS domain info
239 */
240 static NTSTATUS lsa_info_DNS(struct lsa_policy_state *state, TALLOC_CTX *mem_ctx,
241                              struct lsa_DnsDomainInfo *info)
242 {
243         const char * const attrs[] = { "name", "dnsDomain", "objectGUID", "objectSid", NULL };
244         int ret;
245         struct ldb_message **res;
246
247         ret = samdb_search(state->sam_ctx, mem_ctx, NULL, &res, attrs, 
248                            "dn=%s", state->domain_dn);
249         if (ret != 1) {
250                 return NT_STATUS_INTERNAL_DB_CORRUPTION;
251         }
252
253         info->name.name       = samdb_result_string(res[0],           "name", NULL);
254         info->dns_domain.name = samdb_result_string(res[0],           "dnsDomain", NULL);
255         info->dns_forest.name = samdb_result_string(res[0],           "dnsDomain", NULL);
256         info->domain_guid     = samdb_result_guid(res[0],             "objectGUID");
257         info->sid             = samdb_result_dom_sid(mem_ctx, res[0], "objectSid");
258
259         return NT_STATUS_OK;
260 }
261
262 /* 
263   lsa_QueryInfoPolicy2
264 */
265 static NTSTATUS lsa_QueryInfoPolicy2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
266                                      struct lsa_QueryInfoPolicy2 *r)
267 {
268         struct lsa_policy_state *state;
269         struct dcesrv_handle *h;
270
271         r->out.info = NULL;
272
273         DCESRV_PULL_HANDLE(h, r->in.handle, LSA_HANDLE_POLICY);
274
275         state = h->data;
276
277         r->out.info = talloc_p(mem_ctx, union lsa_PolicyInformation);
278         if (!r->out.info) {
279                 return NT_STATUS_NO_MEMORY;
280         }
281
282         ZERO_STRUCTP(r->out.info);
283
284         switch (r->in.level) {
285         case LSA_POLICY_INFO_DOMAIN:
286         case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
287                 return lsa_info_AccountDomain(state, mem_ctx, &r->out.info->account_domain);
288
289         case LSA_POLICY_INFO_DNS:
290                 return lsa_info_DNS(state, mem_ctx, &r->out.info->dns);
291         }
292
293         return NT_STATUS_INVALID_INFO_CLASS;
294 }
295
296 /* 
297   lsa_QueryInfoPolicy 
298 */
299 static NTSTATUS lsa_QueryInfoPolicy(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
300                                     struct lsa_QueryInfoPolicy *r)
301 {
302         struct lsa_QueryInfoPolicy2 r2;
303         NTSTATUS status;
304
305         r2.in.handle = r->in.handle;
306         r2.in.level = r->in.level;
307         
308         status = lsa_QueryInfoPolicy2(dce_call, mem_ctx, &r2);
309
310         r->out.info = r2.out.info;
311
312         return status;
313 }
314
315 /* 
316   lsa_SetInfoPolicy 
317 */
318 static NTSTATUS lsa_SetInfoPolicy(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
319                                   struct lsa_SetInfoPolicy *r)
320 {
321         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
322 }
323
324
325 /* 
326   lsa_ClearAuditLog 
327 */
328 static NTSTATUS lsa_ClearAuditLog(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
329                                   struct lsa_ClearAuditLog *r)
330 {
331         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
332 }
333
334
335 /* 
336   lsa_CreateAccount 
337 */
338 static NTSTATUS lsa_CreateAccount(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
339                                   struct lsa_CreateAccount *r)
340 {
341         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
342 }
343
344
345 /* 
346   lsa_EnumAccounts 
347 */
348 static NTSTATUS lsa_EnumAccounts(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
349                                  struct lsa_EnumAccounts *r)
350 {
351         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
352 }
353
354
355 /* 
356   lsa_CreateTrustedDomain 
357 */
358 static NTSTATUS lsa_CreateTrustedDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
359                                         struct lsa_CreateTrustedDomain *r)
360 {
361         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
362 }
363
364
365 /* 
366   lsa_EnumTrustDom 
367 */
368 static NTSTATUS lsa_EnumTrustDom(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
369                        struct lsa_EnumTrustDom *r)
370 {
371         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
372 }
373
374
375 /* 
376   lsa_LookupNames 
377 */
378 static NTSTATUS lsa_LookupNames(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
379                        struct lsa_LookupNames *r)
380 {
381         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
382 }
383
384
385 /* 
386   lsa_LookupSids 
387 */
388 static NTSTATUS lsa_LookupSids(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
389                                struct lsa_LookupSids *r)
390 {
391         struct lsa_policy_state *state;
392         struct dcesrv_handle *h;
393         int i;
394         NTSTATUS status = NT_STATUS_OK;
395
396         r->out.domains = NULL;
397
398         DCESRV_PULL_HANDLE(h, r->in.handle, LSA_HANDLE_POLICY);
399
400         state = h->data;
401
402         r->out.domains = talloc_zero_p(mem_ctx,  struct lsa_RefDomainList);
403         if (r->out.domains == NULL) {
404                 return NT_STATUS_NO_MEMORY;
405         }
406
407         r->out.names = talloc_zero_p(mem_ctx,  struct lsa_TransNameArray);
408         if (r->out.domains == NULL) {
409                 return NT_STATUS_NO_MEMORY;
410         }
411
412         *r->out.count = 0;
413
414         r->out.names->names = talloc_array_p(r->out.names, struct lsa_TranslatedName, 
415                                              r->in.sids->num_sids);
416         if (r->out.names->names == NULL) {
417                 return NT_STATUS_NO_MEMORY;
418         }
419
420         for (i=0;i<r->in.sids->num_sids;i++) {
421                 const char * const attrs[] = { "sAMAccountName", "sAMAccountType", NULL};
422                 struct dom_sid *sid = r->in.sids->sids[i].sid;
423                 char *sid_str = dom_sid_string(mem_ctx, sid);
424                 int ret, j;
425                 struct ldb_message **res;
426                 const char *name, *authority_name;
427                 struct dom_sid *authority_sid;
428                 uint32_t atype, rtype;
429                 const struct {
430                         const char *sid_prefix;
431                         const char *authority_name;
432                 } authority_names[] = {
433                         { "S-1-5", "NT AUTHORITY" }
434                 };
435
436                 r->out.names->count++;
437                 (*r->out.count)++;
438
439                 r->out.names->names[i].sid_type = SID_NAME_UNKNOWN;
440                 r->out.names->names[i].name.name = sid_str;
441                 r->out.names->names[i].sid_index = 0xFFFFFFFF;
442
443                 if (sid_str == NULL) {
444                         r->out.names->names[i].name.name = "(SIDERROR)";
445                         status = STATUS_SOME_UNMAPPED;
446                         continue;
447                 }
448
449                 /* work out the authority name */
450                 authority_name = talloc_strndup(mem_ctx, sid_str, 5);
451                 authority_sid = dom_sid_parse_talloc(mem_ctx, authority_name);
452                 if (!authority_name || !authority_sid) {
453                         return NT_STATUS_NO_MEMORY;
454                 }
455                 for (j=0;j<ARRAY_SIZE(authority_names);j++) {
456                         if (strncmp(sid_str, authority_names[j].sid_prefix, 
457                                     strlen(authority_names[j].sid_prefix)) == 0) {
458                                 authority_name = authority_names[j].authority_name;
459                                 break;
460                         }
461                 }
462
463                 /* see if we've already done this authority name */
464                 for (j=0;j<r->out.domains->count;j++) {
465                         if (strcmp(authority_name, r->out.domains->domains[j].name.name) == 0) {
466                                 break;
467                         }
468                 }
469                 if (j == r->out.domains->count) {
470                         r->out.domains->domains = talloc_realloc_p(r->out.domains, 
471                                                                    r->out.domains->domains,
472                                                                    struct lsa_TrustInformation,
473                                                                    r->out.domains->count+1);
474                         if (r->out.domains == NULL) {
475                                 return NT_STATUS_NO_MEMORY;
476                         }
477                         r->out.domains->domains[j].name.name = authority_name;
478                         r->out.domains->domains[j].sid = authority_sid;
479                         r->out.domains->count++;
480                 }
481
482                 ret = samdb_search(state->sam_ctx, mem_ctx, NULL, &res, attrs, "objectSid=%s", sid_str);
483                 if (ret != 1) {
484                         status = STATUS_SOME_UNMAPPED;
485                         continue;
486                 }
487
488                 name = ldb_msg_find_string(res[0], "sAMAccountName", NULL);
489                 if (name == NULL) {
490                         status = STATUS_SOME_UNMAPPED;
491                         continue;
492                 }
493
494                 atype = samdb_result_uint(res[0], "sAMAccountType", 0);
495                 if (atype == 0) {
496                         status = STATUS_SOME_UNMAPPED;
497                         continue;
498                 }
499
500                 rtype = samdb_atype_map(atype);
501                 if (rtype == SID_NAME_UNKNOWN) {
502                         status = STATUS_SOME_UNMAPPED;
503                         continue;
504                 }
505
506                 r->out.names->names[i].sid_type = rtype;
507                 r->out.names->names[i].name.name = name;
508                 r->out.names->names[i].sid_index = 0;
509         }
510         
511         return status;
512 }
513
514
515 /* 
516   lsa_CreateSecret 
517 */
518 static NTSTATUS lsa_CreateSecret(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
519                        struct lsa_CreateSecret *r)
520 {
521         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
522 }
523
524
525 /* 
526   lsa_OpenAccount 
527 */
528 static NTSTATUS lsa_OpenAccount(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
529                        struct lsa_OpenAccount *r)
530 {
531         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
532 }
533
534
535 /* 
536   lsa_EnumPrivsAccount 
537 */
538 static NTSTATUS lsa_EnumPrivsAccount(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
539                        struct lsa_EnumPrivsAccount *r)
540 {
541         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
542 }
543
544
545 /* 
546   lsa_AddPrivilegesToAccount
547 */
548 static NTSTATUS lsa_AddPrivilegesToAccount(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
549                        struct lsa_AddPrivilegesToAccount *r)
550 {
551         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
552 }
553
554
555 /* 
556   lsa_RemovePrivilegesFromAccount
557 */
558 static NTSTATUS lsa_RemovePrivilegesFromAccount(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
559                        struct lsa_RemovePrivilegesFromAccount *r)
560 {
561         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
562 }
563
564
565 /* 
566   lsa_GetQuotasForAccount
567 */
568 static NTSTATUS lsa_GetQuotasForAccount(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
569                        struct lsa_GetQuotasForAccount *r)
570 {
571         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
572 }
573
574
575 /* 
576   lsa_SetQuotasForAccount
577 */
578 static NTSTATUS lsa_SetQuotasForAccount(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
579                        struct lsa_SetQuotasForAccount *r)
580 {
581         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
582 }
583
584
585 /* 
586   lsa_GetSystemAccessAccount
587 */
588 static NTSTATUS lsa_GetSystemAccessAccount(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
589                        struct lsa_GetSystemAccessAccount *r)
590 {
591         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
592 }
593
594
595 /* 
596   lsa_SetSystemAccessAccount
597 */
598 static NTSTATUS lsa_SetSystemAccessAccount(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
599                        struct lsa_SetSystemAccessAccount *r)
600 {
601         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
602 }
603
604
605 /* 
606   lsa_OpenTrustedDomain
607 */
608 static NTSTATUS lsa_OpenTrustedDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
609                        struct lsa_OpenTrustedDomain *r)
610 {
611         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
612 }
613
614
615 /* 
616   lsa_QueryInfoTrustedDomain
617 */
618 static NTSTATUS lsa_QueryInfoTrustedDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
619                        struct lsa_QueryInfoTrustedDomain *r)
620 {
621         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
622 }
623
624
625 /* 
626   lsa_SetInformationTrustedDomain
627 */
628 static NTSTATUS lsa_SetInformationTrustedDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
629                        struct lsa_SetInformationTrustedDomain *r)
630 {
631         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
632 }
633
634
635 /* 
636   lsa_OpenSecret 
637 */
638 static NTSTATUS lsa_OpenSecret(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
639                        struct lsa_OpenSecret *r)
640 {
641         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
642 }
643
644
645 /* 
646   lsa_SetSecret 
647 */
648 static NTSTATUS lsa_SetSecret(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
649                        struct lsa_SetSecret *r)
650 {
651         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
652 }
653
654
655 /* 
656   lsa_QuerySecret 
657 */
658 static NTSTATUS lsa_QuerySecret(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
659                        struct lsa_QuerySecret *r)
660 {
661         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
662 }
663
664
665 /* 
666   lsa_LookupPrivValue
667 */
668 static NTSTATUS lsa_LookupPrivValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
669                        struct lsa_LookupPrivValue *r)
670 {
671         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
672 }
673
674
675 /* 
676   lsa_LookupPrivName 
677 */
678 static NTSTATUS lsa_LookupPrivName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
679                        struct lsa_LookupPrivName *r)
680 {
681         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
682 }
683
684
685 /* 
686   lsa_LookupPrivDisplayName
687 */
688 static NTSTATUS lsa_LookupPrivDisplayName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
689                        struct lsa_LookupPrivDisplayName *r)
690 {
691         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
692 }
693
694
695 /* 
696   lsa_DeleteObject
697 */
698 static NTSTATUS lsa_DeleteObject(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
699                        struct lsa_DeleteObject *r)
700 {
701         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
702 }
703
704
705 /* 
706   lsa_EnumAccountsWithUserRight
707 */
708 static NTSTATUS lsa_EnumAccountsWithUserRight(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
709                        struct lsa_EnumAccountsWithUserRight *r)
710 {
711         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
712 }
713
714
715 /* 
716   lsa_EnumAccountRights 
717 */
718 static NTSTATUS lsa_EnumAccountRights(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
719                        struct lsa_EnumAccountRights *r)
720 {
721         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
722 }
723
724
725 /* 
726   lsa_AddAccountRights
727 */
728 static NTSTATUS lsa_AddAccountRights(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
729                        struct lsa_AddAccountRights *r)
730 {
731         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
732 }
733
734
735 /* 
736   lsa_RemoveAccountRights
737 */
738 static NTSTATUS lsa_RemoveAccountRights(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
739                        struct lsa_RemoveAccountRights *r)
740 {
741         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
742 }
743
744
745 /* 
746   lsa_QueryTrustDomainInfo
747 */
748 static NTSTATUS lsa_QueryTrustDomainInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
749                        struct lsa_QueryTrustDomainInfo *r)
750 {
751         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
752 }
753
754
755 /* 
756   lsa_SetTrustDomainInfo
757 */
758 static NTSTATUS lsa_SetTrustDomainInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
759                        struct lsa_SetTrustDomainInfo *r)
760 {
761         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
762 }
763
764
765 /* 
766   lsa_DeleteTrustDomain
767 */
768 static NTSTATUS lsa_DeleteTrustDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
769                        struct lsa_DeleteTrustDomain *r)
770 {
771         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
772 }
773
774
775 /* 
776   lsa_StorePrivateData
777 */
778 static NTSTATUS lsa_StorePrivateData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
779                        struct lsa_StorePrivateData *r)
780 {
781         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
782 }
783
784
785 /* 
786   lsa_RetrievePrivateData
787 */
788 static NTSTATUS lsa_RetrievePrivateData(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
789                        struct lsa_RetrievePrivateData *r)
790 {
791         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
792 }
793
794
795 /* 
796   lsa_GetUserName
797 */
798 static NTSTATUS lsa_GetUserName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
799                        struct lsa_GetUserName *r)
800 {
801         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
802 }
803
804 /*
805   lsa_SetInfoPolicy2
806 */
807 static NTSTATUS lsa_SetInfoPolicy2(struct dcesrv_call_state *dce_call,
808                                    TALLOC_CTX *mem_ctx,
809                                    struct lsa_SetInfoPolicy2 *r)
810 {
811         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
812 }
813
814 /*
815   lsa_QueryTrustedDomainInfoByName
816 */
817 static NTSTATUS lsa_QueryTrustedDomainInfoByName(struct dcesrv_call_state *dce_call,
818                                                  TALLOC_CTX *mem_ctx,
819                                                  struct lsa_QueryTrustedDomainInfoByName *r)
820 {
821         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
822 }
823
824 /*
825   lsa_SetTrustedDomainInfoByName
826 */
827 static NTSTATUS lsa_SetTrustedDomainInfoByName(struct dcesrv_call_state *dce_call,
828                                                TALLOC_CTX *mem_ctx,
829                                                struct lsa_SetTrustedDomainInfoByName *r)
830 {
831         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
832 }
833
834 /*
835   lsa_EnumTrustedDomainsEx
836 */
837 static NTSTATUS lsa_EnumTrustedDomainsEx(struct dcesrv_call_state *dce_call,
838                                          TALLOC_CTX *mem_ctx,
839                                          struct lsa_EnumTrustedDomainsEx *r)
840 {
841         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
842 }
843
844 /*
845   lsa_CreateTrustedDomainEx
846 */
847 static NTSTATUS lsa_CreateTrustedDomainEx(struct dcesrv_call_state *dce_call,
848                                           TALLOC_CTX *mem_ctx,
849                                           struct lsa_CreateTrustedDomainEx *r)
850 {
851         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
852 }
853
854 /*
855   lsa_CloseTrustedDomainEx
856 */
857 static NTSTATUS lsa_CloseTrustedDomainEx(struct dcesrv_call_state *dce_call,
858                                          TALLOC_CTX *mem_ctx,
859                                          struct lsa_CloseTrustedDomainEx *r)
860 {
861         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
862 }
863
864 /*
865   lsa_QueryDomainInformationPolicy
866 */
867 static NTSTATUS lsa_QueryDomainInformationPolicy(struct dcesrv_call_state *dce_call,
868                                                  TALLOC_CTX *mem_ctx,
869                                                  struct lsa_QueryDomainInformationPolicy *r)
870 {
871         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
872 }
873
874 /*
875   lsa_SetDomInfoPolicy
876 */
877 static NTSTATUS lsa_SetDomInfoPolicy(struct dcesrv_call_state *dce_call,
878                                      TALLOC_CTX *mem_ctx,
879                                      struct lsa_SetDomInfoPolicy *r)
880 {
881         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
882 }
883
884 /*
885   lsa_OpenTrustedDomainByName
886 */
887 static NTSTATUS lsa_OpenTrustedDomainByName(struct dcesrv_call_state *dce_call,
888                                             TALLOC_CTX *mem_ctx,
889                                             struct lsa_OpenTrustedDomainByName *r)
890 {
891         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
892 }
893
894 /*
895   lsa_TestCall
896 */
897 static NTSTATUS lsa_TestCall(struct dcesrv_call_state *dce_call,
898                              TALLOC_CTX *mem_ctx,
899                              struct lsa_TestCall *r)
900 {
901         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
902 }
903
904 /*
905   lsa_LookupSids2
906 */
907 static NTSTATUS lsa_LookupSids2(struct dcesrv_call_state *dce_call,
908                                 TALLOC_CTX *mem_ctx,
909                                 struct lsa_LookupSids2 *r)
910 {
911         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
912 }
913
914 /*
915   lsa_LookupNames2
916 */
917 static NTSTATUS lsa_LookupNames2(struct dcesrv_call_state *dce_call,
918                                  TALLOC_CTX *mem_ctx,
919                                  struct lsa_LookupNames2 *r)
920 {
921         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
922 }
923
924 /*
925   lsa_CreateTrustedDomainEx2
926 */
927 static NTSTATUS lsa_CreateTrustedDomainEx2(struct dcesrv_call_state *dce_call,
928                                            TALLOC_CTX *mem_ctx,
929                                            struct lsa_CreateTrustedDomainEx2 *r)
930 {
931         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
932 }
933
934 /* include the generated boilerplate */
935 #include "librpc/gen_ndr/ndr_lsa_s.c"