2 * Unix SMB/CIFS implementation.
4 * Winbind rpc backend functions
6 * Copyright (c) 2000-2003 Tim Potter
7 * Copyright (c) 2001 Andrew Tridgell
8 * Copyright (c) 2005 Volker Lendecke
9 * Copyright (c) 2008 Guenther Deschner (pidl conversion)
10 * Copyright (c) 2010 Andreas Schneider <asn@samba.org>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 #include "winbindd_rpc.h"
29 #include "lib/util_unixsids.h"
30 #include "rpc_client/rpc_client.h"
31 #include "../librpc/gen_ndr/ndr_samr_c.h"
32 #include "rpc_client/cli_samr.h"
33 #include "../librpc/gen_ndr/ndr_lsa_c.h"
34 #include "rpc_client/cli_lsarpc.h"
35 #include "rpc_server/rpc_ncacn_np.h"
36 #include "../libcli/security/security.h"
37 #include "passdb/machine_sid.h"
41 #define DBGC_CLASS DBGC_WINBIND
43 NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
44 struct winbindd_domain *domain,
45 struct rpc_pipe_client **samr_pipe,
46 struct policy_handle *samr_domain_hnd)
48 NTSTATUS status, result;
49 struct policy_handle samr_connect_hnd;
50 struct dcerpc_binding_handle *b;
52 status = wb_open_internal_pipe(mem_ctx, &ndr_table_samr, samr_pipe);
53 if (!NT_STATUS_IS_OK(status)) {
57 b = (*samr_pipe)->binding_handle;
59 status = dcerpc_samr_Connect2(b, mem_ctx,
60 (*samr_pipe)->desthost,
61 SEC_FLAG_MAXIMUM_ALLOWED,
64 if (!NT_STATUS_IS_OK(status)) {
67 if (!NT_STATUS_IS_OK(result)) {
71 status = dcerpc_samr_OpenDomain(b, mem_ctx,
73 SEC_FLAG_MAXIMUM_ALLOWED,
77 if (!NT_STATUS_IS_OK(status)) {
84 NTSTATUS open_internal_lsa_conn(TALLOC_CTX *mem_ctx,
85 struct rpc_pipe_client **lsa_pipe,
86 struct policy_handle *lsa_hnd)
90 status = wb_open_internal_pipe(mem_ctx, &ndr_table_lsarpc, lsa_pipe);
91 if (!NT_STATUS_IS_OK(status)) {
95 status = rpccli_lsa_open_policy((*lsa_pipe),
98 SEC_FLAG_MAXIMUM_ALLOWED,
104 /*********************************************************************
105 SAM specific functions.
106 *********************************************************************/
108 /* List all domain groups */
109 static NTSTATUS sam_enum_dom_groups(struct winbindd_domain *domain,
112 struct wb_acct_info **pinfo)
114 struct rpc_pipe_client *samr_pipe;
115 struct policy_handle dom_pol;
116 struct wb_acct_info *info = NULL;
117 uint32_t num_info = 0;
119 NTSTATUS status, result;
120 struct dcerpc_binding_handle *b = NULL;
122 DEBUG(3,("sam_enum_dom_groups\n"));
124 ZERO_STRUCT(dom_pol);
130 tmp_ctx = talloc_stackframe();
131 if (tmp_ctx == NULL) {
132 return NT_STATUS_NO_MEMORY;
135 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
136 if (!NT_STATUS_IS_OK(status)) {
140 b = samr_pipe->binding_handle;
142 status = rpc_enum_dom_groups(tmp_ctx,
147 if (!NT_STATUS_IS_OK(status)) {
152 *pnum_info = num_info;
156 *pinfo = talloc_move(mem_ctx, &info);
160 if (b && is_valid_policy_hnd(&dom_pol)) {
161 dcerpc_samr_Close(b, mem_ctx, &dom_pol, &result);
163 TALLOC_FREE(tmp_ctx);
167 /* Query display info for a domain */
168 static NTSTATUS sam_query_user_list(struct winbindd_domain *domain,
171 struct wbint_userinfo **pinfo)
173 struct rpc_pipe_client *samr_pipe = NULL;
174 struct policy_handle dom_pol;
175 struct wbint_userinfo *info = NULL;
176 uint32_t num_info = 0;
178 NTSTATUS status, result;
179 struct dcerpc_binding_handle *b = NULL;
181 DEBUG(3,("samr_query_user_list\n"));
183 ZERO_STRUCT(dom_pol);
189 tmp_ctx = talloc_stackframe();
190 if (tmp_ctx == NULL) {
191 return NT_STATUS_NO_MEMORY;
194 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
195 if (!NT_STATUS_IS_OK(status)) {
199 b = samr_pipe->binding_handle;
201 status = rpc_query_user_list(tmp_ctx,
207 if (!NT_STATUS_IS_OK(status)) {
212 *pnum_info = num_info;
216 *pinfo = talloc_move(mem_ctx, &info);
220 if (b && is_valid_policy_hnd(&dom_pol)) {
221 dcerpc_samr_Close(b, mem_ctx, &dom_pol, &result);
224 TALLOC_FREE(tmp_ctx);
228 /* Lookup user information from a rid or username. */
229 static NTSTATUS sam_query_user(struct winbindd_domain *domain,
231 const struct dom_sid *user_sid,
232 struct wbint_userinfo *user_info)
234 struct rpc_pipe_client *samr_pipe;
235 struct policy_handle dom_pol;
237 NTSTATUS status, result;
238 struct dcerpc_binding_handle *b = NULL;
240 DEBUG(3,("sam_query_user\n"));
242 ZERO_STRUCT(dom_pol);
245 if (!sid_check_is_in_our_sam(user_sid)) {
246 return NT_STATUS_NO_SUCH_USER;
249 user_info->homedir = NULL;
250 user_info->shell = NULL;
251 user_info->primary_gid = (gid_t) -1;
253 tmp_ctx = talloc_stackframe();
254 if (tmp_ctx == NULL) {
255 return NT_STATUS_NO_MEMORY;
258 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
259 if (!NT_STATUS_IS_OK(status)) {
263 b = samr_pipe->binding_handle;
265 status = rpc_query_user(tmp_ctx,
273 if (b && is_valid_policy_hnd(&dom_pol)) {
274 dcerpc_samr_Close(b, mem_ctx, &dom_pol, &result);
277 TALLOC_FREE(tmp_ctx);
281 /* get a list of trusted domains - builtin domain */
282 static NTSTATUS sam_trusted_domains(struct winbindd_domain *domain,
284 struct netr_DomainTrustList *ptrust_list)
286 struct rpc_pipe_client *lsa_pipe;
287 struct policy_handle lsa_policy;
288 struct netr_DomainTrust *trusts = NULL;
289 uint32_t num_trusts = 0;
291 NTSTATUS status, result;
292 struct dcerpc_binding_handle *b = NULL;
294 DEBUG(3,("samr: trusted domains\n"));
296 ZERO_STRUCT(lsa_policy);
299 ZERO_STRUCTP(ptrust_list);
302 tmp_ctx = talloc_stackframe();
303 if (tmp_ctx == NULL) {
304 return NT_STATUS_NO_MEMORY;
307 status = open_internal_lsa_conn(tmp_ctx, &lsa_pipe, &lsa_policy);
308 if (!NT_STATUS_IS_OK(status)) {
312 b = lsa_pipe->binding_handle;
314 status = rpc_trusted_domains(tmp_ctx,
319 if (!NT_STATUS_IS_OK(status)) {
324 ptrust_list->count = num_trusts;
325 ptrust_list->array = talloc_move(mem_ctx, &trusts);
329 if (b && is_valid_policy_hnd(&lsa_policy)) {
330 dcerpc_lsa_Close(b, mem_ctx, &lsa_policy, &result);
333 TALLOC_FREE(tmp_ctx);
337 /* Lookup group membership given a rid. */
338 static NTSTATUS sam_lookup_groupmem(struct winbindd_domain *domain,
340 const struct dom_sid *group_sid,
341 enum lsa_SidType type,
342 uint32_t *pnum_names,
343 struct dom_sid **psid_mem,
345 uint32_t **pname_types)
347 struct rpc_pipe_client *samr_pipe;
348 struct policy_handle dom_pol;
350 uint32_t num_names = 0;
351 struct dom_sid *sid_mem = NULL;
353 uint32_t *name_types = NULL;
356 NTSTATUS status, result;
357 struct dcerpc_binding_handle *b = NULL;
359 DEBUG(3,("sam_lookup_groupmem\n"));
361 ZERO_STRUCT(dom_pol);
364 if (sid_check_is_in_builtin(group_sid) && (type != SID_NAME_ALIAS)) {
365 /* There's no groups, only aliases in BUILTIN */
366 return NT_STATUS_NO_SUCH_GROUP;
373 tmp_ctx = talloc_stackframe();
374 if (tmp_ctx == NULL) {
375 return NT_STATUS_NO_MEMORY;
378 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
379 if (!NT_STATUS_IS_OK(status)) {
383 b = samr_pipe->binding_handle;
385 status = rpc_lookup_groupmem(tmp_ctx,
398 *pnum_names = num_names;
402 *pnames = talloc_move(mem_ctx, &names);
406 *pname_types = talloc_move(mem_ctx, &name_types);
410 *psid_mem = talloc_move(mem_ctx, &sid_mem);
414 if (b && is_valid_policy_hnd(&dom_pol)) {
415 dcerpc_samr_Close(b, mem_ctx, &dom_pol, &result);
418 TALLOC_FREE(tmp_ctx);
422 /*********************************************************************
423 BUILTIN specific functions.
424 *********************************************************************/
426 /* List all domain groups */
427 static NTSTATUS builtin_enum_dom_groups(struct winbindd_domain *domain,
429 uint32_t *num_entries,
430 struct wb_acct_info **info)
432 /* BUILTIN doesn't have domain groups */
438 /* Query display info for a domain */
439 static NTSTATUS builtin_query_user_list(struct winbindd_domain *domain,
441 uint32_t *num_entries,
442 struct wbint_userinfo **info)
444 /* We don't have users */
450 /* Lookup user information from a rid or username. */
451 static NTSTATUS builtin_query_user(struct winbindd_domain *domain,
453 const struct dom_sid *user_sid,
454 struct wbint_userinfo *user_info)
456 return NT_STATUS_NO_SUCH_USER;
459 /* get a list of trusted domains - builtin domain */
460 static NTSTATUS builtin_trusted_domains(struct winbindd_domain *domain,
462 struct netr_DomainTrustList *trusts)
464 ZERO_STRUCTP(trusts);
468 /*********************************************************************
470 *********************************************************************/
472 /* List all local groups (aliases) */
473 static NTSTATUS sam_enum_local_groups(struct winbindd_domain *domain,
476 struct wb_acct_info **pinfo)
478 struct rpc_pipe_client *samr_pipe;
479 struct policy_handle dom_pol;
480 struct wb_acct_info *info = NULL;
481 uint32_t num_info = 0;
483 NTSTATUS status, result;
484 struct dcerpc_binding_handle *b = NULL;
486 DEBUG(3,("samr: enum local groups\n"));
488 ZERO_STRUCT(dom_pol);
494 tmp_ctx = talloc_stackframe();
495 if (tmp_ctx == NULL) {
496 return NT_STATUS_NO_MEMORY;
499 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
500 if (!NT_STATUS_IS_OK(status)) {
504 b = samr_pipe->binding_handle;
506 status = rpc_enum_local_groups(mem_ctx,
511 if (!NT_STATUS_IS_OK(status)) {
516 *pnum_info = num_info;
520 *pinfo = talloc_move(mem_ctx, &info);
524 if (b && is_valid_policy_hnd(&dom_pol)) {
525 dcerpc_samr_Close(b, mem_ctx, &dom_pol, &result);
528 TALLOC_FREE(tmp_ctx);
532 /* convert a single name to a sid in a domain */
533 static NTSTATUS sam_name_to_sid(struct winbindd_domain *domain,
535 const char *domain_name,
538 struct dom_sid *psid,
539 enum lsa_SidType *ptype)
541 struct rpc_pipe_client *lsa_pipe;
542 struct policy_handle lsa_policy;
544 enum lsa_SidType type;
546 NTSTATUS status, result;
547 struct dcerpc_binding_handle *b = NULL;
549 DEBUG(3,("sam_name_to_sid\n"));
551 ZERO_STRUCT(lsa_policy);
553 tmp_ctx = talloc_stackframe();
554 if (tmp_ctx == NULL) {
555 return NT_STATUS_NO_MEMORY;
558 status = open_internal_lsa_conn(tmp_ctx, &lsa_pipe, &lsa_policy);
559 if (!NT_STATUS_IS_OK(status)) {
563 b = lsa_pipe->binding_handle;
565 status = rpc_name_to_sid(tmp_ctx,
573 if (!NT_STATUS_IS_OK(status)) {
578 sid_copy(psid, &sid);
585 if (b && is_valid_policy_hnd(&lsa_policy)) {
586 dcerpc_lsa_Close(b, mem_ctx, &lsa_policy, &result);
589 TALLOC_FREE(tmp_ctx);
593 /* convert a domain SID to a user or group name */
594 static NTSTATUS sam_sid_to_name(struct winbindd_domain *domain,
596 const struct dom_sid *sid,
599 enum lsa_SidType *ptype)
601 struct rpc_pipe_client *lsa_pipe;
602 struct policy_handle lsa_policy;
603 char *domain_name = NULL;
605 enum lsa_SidType type;
607 NTSTATUS status, result;
608 struct dcerpc_binding_handle *b = NULL;
610 DEBUG(3,("sam_sid_to_name\n"));
612 ZERO_STRUCT(lsa_policy);
615 if (!sid_check_is_in_builtin(sid) &&
616 !sid_check_is_builtin(sid) &&
617 !sid_check_is_in_our_sam(sid) &&
618 !sid_check_is_our_sam(sid) &&
619 !sid_check_is_in_unix_users(sid) &&
620 !sid_check_is_unix_users(sid) &&
621 !sid_check_is_in_unix_groups(sid) &&
622 !sid_check_is_unix_groups(sid) &&
623 !sid_check_is_in_wellknown_domain(sid)) {
624 DEBUG(0, ("sam_sid_to_name: possible deadlock - trying to "
625 "lookup SID %s\n", sid_string_dbg(sid)));
626 return NT_STATUS_NONE_MAPPED;
629 tmp_ctx = talloc_stackframe();
630 if (tmp_ctx == NULL) {
631 return NT_STATUS_NO_MEMORY;
634 status = open_internal_lsa_conn(tmp_ctx, &lsa_pipe, &lsa_policy);
635 if (!NT_STATUS_IS_OK(status)) {
639 b = lsa_pipe->binding_handle;
641 status = rpc_sid_to_name(tmp_ctx,
655 *pname = talloc_move(mem_ctx, &name);
659 *pdomain_name = talloc_move(mem_ctx, &domain_name);
663 if (b && is_valid_policy_hnd(&lsa_policy)) {
664 dcerpc_lsa_Close(b, mem_ctx, &lsa_policy, &result);
667 TALLOC_FREE(tmp_ctx);
671 static NTSTATUS sam_rids_to_names(struct winbindd_domain *domain,
673 const struct dom_sid *domain_sid,
678 enum lsa_SidType **ptypes)
680 struct rpc_pipe_client *lsa_pipe;
681 struct policy_handle lsa_policy;
682 enum lsa_SidType *types = NULL;
683 char *domain_name = NULL;
686 NTSTATUS status, result;
687 struct dcerpc_binding_handle *b = NULL;
689 DEBUG(3,("sam_rids_to_names for %s\n", domain->name));
691 ZERO_STRUCT(lsa_policy);
694 if (!sid_check_is_builtin(domain_sid) &&
695 !sid_check_is_our_sam(domain_sid) &&
696 !sid_check_is_unix_users(domain_sid) &&
697 !sid_check_is_unix_groups(domain_sid) &&
698 !sid_check_is_in_wellknown_domain(domain_sid)) {
699 DEBUG(0, ("sam_rids_to_names: possible deadlock - trying to "
700 "lookup SID %s\n", sid_string_dbg(domain_sid)));
701 return NT_STATUS_NONE_MAPPED;
704 tmp_ctx = talloc_stackframe();
705 if (tmp_ctx == NULL) {
706 return NT_STATUS_NO_MEMORY;
709 status = open_internal_lsa_conn(tmp_ctx, &lsa_pipe, &lsa_policy);
710 if (!NT_STATUS_IS_OK(status)) {
714 b = lsa_pipe->binding_handle;
716 status = rpc_rids_to_names(tmp_ctx,
726 if (!NT_STATUS_IS_OK(status)) {
731 *pdomain_name = talloc_move(mem_ctx, &domain_name);
735 *ptypes = talloc_move(mem_ctx, &types);
739 *pnames = talloc_move(mem_ctx, &names);
743 if (b && is_valid_policy_hnd(&lsa_policy)) {
744 dcerpc_lsa_Close(b, mem_ctx, &lsa_policy, &result);
747 TALLOC_FREE(tmp_ctx);
751 static NTSTATUS sam_lockout_policy(struct winbindd_domain *domain,
753 struct samr_DomInfo12 *lockout_policy)
755 struct rpc_pipe_client *samr_pipe;
756 struct policy_handle dom_pol;
757 union samr_DomainInfo *info = NULL;
759 NTSTATUS status, result;
760 struct dcerpc_binding_handle *b = NULL;
762 DEBUG(3,("sam_lockout_policy\n"));
764 ZERO_STRUCT(dom_pol);
766 tmp_ctx = talloc_stackframe();
767 if (tmp_ctx == NULL) {
768 return NT_STATUS_NO_MEMORY;
771 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
772 if (!NT_STATUS_IS_OK(status)) {
776 b = samr_pipe->binding_handle;
778 status = dcerpc_samr_QueryDomainInfo(b,
781 DomainLockoutInformation,
784 if (!NT_STATUS_IS_OK(status)) {
787 if (!NT_STATUS_IS_OK(result)) {
792 *lockout_policy = info->info12;
795 if (b && is_valid_policy_hnd(&dom_pol)) {
796 dcerpc_samr_Close(b, mem_ctx, &dom_pol, &result);
799 TALLOC_FREE(tmp_ctx);
803 static NTSTATUS sam_password_policy(struct winbindd_domain *domain,
805 struct samr_DomInfo1 *passwd_policy)
807 struct rpc_pipe_client *samr_pipe;
808 struct policy_handle dom_pol;
809 union samr_DomainInfo *info = NULL;
811 NTSTATUS status, result;
812 struct dcerpc_binding_handle *b = NULL;
814 DEBUG(3,("sam_password_policy\n"));
816 ZERO_STRUCT(dom_pol);
818 tmp_ctx = talloc_stackframe();
819 if (tmp_ctx == NULL) {
820 return NT_STATUS_NO_MEMORY;
823 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
824 if (!NT_STATUS_IS_OK(status)) {
828 b = samr_pipe->binding_handle;
830 status = dcerpc_samr_QueryDomainInfo(b,
833 DomainPasswordInformation,
836 if (!NT_STATUS_IS_OK(status)) {
839 if (!NT_STATUS_IS_OK(result)) {
844 *passwd_policy = info->info1;
847 if (b && is_valid_policy_hnd(&dom_pol)) {
848 dcerpc_samr_Close(b, mem_ctx, &dom_pol, &result);
851 TALLOC_FREE(tmp_ctx);
855 /* Lookup groups a user is a member of. */
856 static NTSTATUS sam_lookup_usergroups(struct winbindd_domain *domain,
858 const struct dom_sid *user_sid,
859 uint32_t *pnum_groups,
860 struct dom_sid **puser_grpsids)
862 struct rpc_pipe_client *samr_pipe;
863 struct policy_handle dom_pol;
864 struct dom_sid *user_grpsids = NULL;
865 uint32_t num_groups = 0;
867 NTSTATUS status, result;
868 struct dcerpc_binding_handle *b = NULL;
870 DEBUG(3,("sam_lookup_usergroups\n"));
872 ZERO_STRUCT(dom_pol);
878 tmp_ctx = talloc_stackframe();
879 if (tmp_ctx == NULL) {
880 return NT_STATUS_NO_MEMORY;
883 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
884 if (!NT_STATUS_IS_OK(status)) {
888 b = samr_pipe->binding_handle;
890 status = rpc_lookup_usergroups(tmp_ctx,
897 if (!NT_STATUS_IS_OK(status)) {
902 *pnum_groups = num_groups;
906 *puser_grpsids = talloc_move(mem_ctx, &user_grpsids);
910 if (b && is_valid_policy_hnd(&dom_pol)) {
911 dcerpc_samr_Close(b, mem_ctx, &dom_pol, &result);
914 TALLOC_FREE(tmp_ctx);
918 static NTSTATUS sam_lookup_useraliases(struct winbindd_domain *domain,
921 const struct dom_sid *sids,
922 uint32_t *pnum_aliases,
923 uint32_t **palias_rids)
925 struct rpc_pipe_client *samr_pipe;
926 struct policy_handle dom_pol;
927 uint32_t num_aliases = 0;
928 uint32_t *alias_rids = NULL;
930 NTSTATUS status, result;
931 struct dcerpc_binding_handle *b = NULL;
933 DEBUG(3,("sam_lookup_useraliases\n"));
935 ZERO_STRUCT(dom_pol);
941 tmp_ctx = talloc_stackframe();
942 if (tmp_ctx == NULL) {
943 return NT_STATUS_NO_MEMORY;
946 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
947 if (!NT_STATUS_IS_OK(status)) {
951 b = samr_pipe->binding_handle;
953 status = rpc_lookup_useraliases(tmp_ctx,
960 if (!NT_STATUS_IS_OK(status)) {
965 *pnum_aliases = num_aliases;
969 *palias_rids = talloc_move(mem_ctx, &alias_rids);
973 if (b && is_valid_policy_hnd(&dom_pol)) {
974 dcerpc_samr_Close(b, mem_ctx, &dom_pol, &result);
977 TALLOC_FREE(tmp_ctx);
981 /* find the sequence number for a domain */
982 static NTSTATUS sam_sequence_number(struct winbindd_domain *domain,
985 struct rpc_pipe_client *samr_pipe;
986 struct policy_handle dom_pol;
987 uint32_t seq = DOM_SEQUENCE_NONE;
989 NTSTATUS status, result;
990 struct dcerpc_binding_handle *b = NULL;
992 DEBUG(3,("samr: sequence number\n"));
994 ZERO_STRUCT(dom_pol);
997 *pseq = DOM_SEQUENCE_NONE;
1000 tmp_ctx = talloc_stackframe();
1001 if (tmp_ctx == NULL) {
1002 return NT_STATUS_NO_MEMORY;
1005 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
1006 if (!NT_STATUS_IS_OK(status)) {
1010 b = samr_pipe->binding_handle;
1012 status = rpc_sequence_number(tmp_ctx,
1017 if (!NT_STATUS_IS_OK(status)) {
1025 if (b && is_valid_policy_hnd(&dom_pol)) {
1026 dcerpc_samr_Close(b, tmp_ctx, &dom_pol, &result);
1029 TALLOC_FREE(tmp_ctx);
1033 /* the rpc backend methods are exposed via this structure */
1034 struct winbindd_methods builtin_passdb_methods = {
1035 .consistent = false,
1037 .query_user_list = builtin_query_user_list,
1038 .enum_dom_groups = builtin_enum_dom_groups,
1039 .enum_local_groups = sam_enum_local_groups,
1040 .name_to_sid = sam_name_to_sid,
1041 .sid_to_name = sam_sid_to_name,
1042 .rids_to_names = sam_rids_to_names,
1043 .query_user = builtin_query_user,
1044 .lookup_usergroups = sam_lookup_usergroups,
1045 .lookup_useraliases = sam_lookup_useraliases,
1046 .lookup_groupmem = sam_lookup_groupmem,
1047 .sequence_number = sam_sequence_number,
1048 .lockout_policy = sam_lockout_policy,
1049 .password_policy = sam_password_policy,
1050 .trusted_domains = builtin_trusted_domains
1053 /* the rpc backend methods are exposed via this structure */
1054 struct winbindd_methods sam_passdb_methods = {
1055 .consistent = false,
1057 .query_user_list = sam_query_user_list,
1058 .enum_dom_groups = sam_enum_dom_groups,
1059 .enum_local_groups = sam_enum_local_groups,
1060 .name_to_sid = sam_name_to_sid,
1061 .sid_to_name = sam_sid_to_name,
1062 .rids_to_names = sam_rids_to_names,
1063 .query_user = sam_query_user,
1064 .lookup_usergroups = sam_lookup_usergroups,
1065 .lookup_useraliases = sam_lookup_useraliases,
1066 .lookup_groupmem = sam_lookup_groupmem,
1067 .sequence_number = sam_sequence_number,
1068 .lockout_policy = sam_lockout_policy,
1069 .password_policy = sam_password_policy,
1070 .trusted_domains = sam_trusted_domains