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"
30 #include "../librpc/gen_ndr/cli_samr.h"
31 #include "rpc_client/cli_samr.h"
32 #include "../librpc/gen_ndr/srv_samr.h"
33 #include "../librpc/gen_ndr/cli_lsa.h"
34 #include "rpc_client/cli_lsarpc.h"
35 #include "../librpc/gen_ndr/srv_lsa.h"
38 #define DBGC_CLASS DBGC_WINBIND
40 static NTSTATUS open_internal_samr_pipe(TALLOC_CTX *mem_ctx,
41 struct rpc_pipe_client **samr_pipe)
43 static struct rpc_pipe_client *cli = NULL;
44 struct auth_serversupplied_info *server_info = NULL;
51 if (server_info == NULL) {
52 status = make_server_info_system(mem_ctx, &server_info);
53 if (!NT_STATUS_IS_OK(status)) {
54 DEBUG(0, ("open_samr_pipe: Could not create auth_serversupplied_info: %s\n",
60 /* create a samr connection */
61 status = rpc_pipe_open_internal(talloc_autofree_context(),
62 &ndr_table_samr.syntax_id,
66 if (!NT_STATUS_IS_OK(status)) {
67 DEBUG(0, ("open_samr_pipe: Could not connect to samr_pipe: %s\n",
80 static NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
81 struct winbindd_domain *domain,
82 struct rpc_pipe_client **samr_pipe,
83 struct policy_handle *samr_domain_hnd)
86 struct policy_handle samr_connect_hnd;
88 status = open_internal_samr_pipe(mem_ctx, samr_pipe);
89 if (!NT_STATUS_IS_OK(status)) {
93 status = rpccli_samr_Connect2((*samr_pipe),
95 (*samr_pipe)->desthost,
96 SEC_FLAG_MAXIMUM_ALLOWED,
98 if (!NT_STATUS_IS_OK(status)) {
102 status = rpccli_samr_OpenDomain((*samr_pipe),
105 SEC_FLAG_MAXIMUM_ALLOWED,
112 static NTSTATUS open_internal_lsa_pipe(TALLOC_CTX *mem_ctx,
113 struct rpc_pipe_client **lsa_pipe)
115 static struct rpc_pipe_client *cli = NULL;
116 struct auth_serversupplied_info *server_info = NULL;
123 if (server_info == NULL) {
124 status = make_server_info_system(mem_ctx, &server_info);
125 if (!NT_STATUS_IS_OK(status)) {
126 DEBUG(0, ("open_samr_pipe: Could not create auth_serversupplied_info: %s\n",
132 /* create a samr connection */
133 status = rpc_pipe_open_internal(talloc_autofree_context(),
134 &ndr_table_lsarpc.syntax_id,
138 if (!NT_STATUS_IS_OK(status)) {
139 DEBUG(0, ("open_samr_pipe: Could not connect to samr_pipe: %s\n",
152 static NTSTATUS open_internal_lsa_conn(TALLOC_CTX *mem_ctx,
153 struct rpc_pipe_client **lsa_pipe,
154 struct policy_handle *lsa_hnd)
158 status = open_internal_lsa_pipe(mem_ctx, lsa_pipe);
159 if (!NT_STATUS_IS_OK(status)) {
163 status = rpccli_lsa_open_policy((*lsa_pipe),
166 SEC_FLAG_MAXIMUM_ALLOWED,
172 /*********************************************************************
173 SAM specific functions.
174 *********************************************************************/
176 /* List all domain groups */
177 static NTSTATUS sam_enum_dom_groups(struct winbindd_domain *domain,
180 struct acct_info **pinfo)
182 struct rpc_pipe_client *samr_pipe;
183 struct policy_handle dom_pol;
184 struct acct_info *info = NULL;
185 uint32_t num_info = 0;
189 DEBUG(3,("sam_enum_dom_groups\n"));
195 tmp_ctx = talloc_stackframe();
196 if (tmp_ctx == NULL) {
197 return NT_STATUS_NO_MEMORY;
200 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
201 if (!NT_STATUS_IS_OK(status)) {
205 status = rpc_enum_dom_groups(tmp_ctx,
210 if (!NT_STATUS_IS_OK(status)) {
215 *pnum_info = num_info;
219 *pinfo = talloc_move(mem_ctx, &info);
223 TALLOC_FREE(tmp_ctx);
227 /* Query display info for a domain */
228 static NTSTATUS sam_query_user_list(struct winbindd_domain *domain,
231 struct wbint_userinfo **pinfo)
233 struct rpc_pipe_client *samr_pipe = NULL;
234 struct policy_handle dom_pol;
235 struct wbint_userinfo *info = NULL;
236 uint32_t num_info = 0;
240 DEBUG(3,("samr_query_user_list\n"));
246 tmp_ctx = talloc_stackframe();
247 if (tmp_ctx == NULL) {
248 return NT_STATUS_NO_MEMORY;
251 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
252 if (!NT_STATUS_IS_OK(status)) {
256 status = rpc_query_user_list(tmp_ctx,
262 if (!NT_STATUS_IS_OK(status)) {
267 *pnum_info = num_info;
271 *pinfo = talloc_move(mem_ctx, &info);
275 TALLOC_FREE(tmp_ctx);
279 /* Lookup user information from a rid or username. */
280 static NTSTATUS sam_query_user(struct winbindd_domain *domain,
282 const struct dom_sid *user_sid,
283 struct wbint_userinfo *user_info)
285 struct rpc_pipe_client *samr_pipe;
286 struct policy_handle dom_pol;
290 DEBUG(3,("sam_query_user\n"));
293 if (!sid_check_is_in_our_domain(user_sid)) {
294 return NT_STATUS_NO_SUCH_USER;
298 user_info->homedir = NULL;
299 user_info->shell = NULL;
300 user_info->primary_gid = (gid_t) -1;
303 tmp_ctx = talloc_stackframe();
304 if (tmp_ctx == NULL) {
305 return NT_STATUS_NO_MEMORY;
308 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
309 if (!NT_STATUS_IS_OK(status)) {
313 status = rpc_query_user(tmp_ctx,
321 TALLOC_FREE(tmp_ctx);
325 /* get a list of trusted domains - builtin domain */
326 static NTSTATUS sam_trusted_domains(struct winbindd_domain *domain,
328 struct netr_DomainTrustList *trusts)
330 struct rpc_pipe_client *lsa_pipe;
331 struct netr_DomainTrust *array = NULL;
332 struct policy_handle lsa_policy;
333 uint32_t enum_ctx = 0;
338 DEBUG(3,("samr: trusted domains\n"));
340 tmp_ctx = talloc_stackframe();
341 if (tmp_ctx == NULL) {
342 return NT_STATUS_NO_MEMORY;
345 status = open_internal_lsa_conn(tmp_ctx, &lsa_pipe, &lsa_policy);
346 if (!NT_STATUS_IS_OK(status)) {
351 struct lsa_DomainList dom_list;
356 * We don't run into deadlocks here, cause winbind_off() is
357 * called in the main function.
359 status = rpccli_lsa_EnumTrustDom(lsa_pipe,
365 if (!NT_STATUS_IS_OK(status)) {
366 if (!NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
371 start_idx = trusts->count;
372 count += dom_list.count;
374 array = talloc_realloc(tmp_ctx,
376 struct netr_DomainTrust,
379 status = NT_STATUS_NO_MEMORY;
383 for (i = 0; i < dom_list.count; i++) {
384 struct netr_DomainTrust *trust = &array[i];
389 trust->netbios_name = talloc_move(array,
390 &dom_list.domains[i].name.string);
391 trust->dns_name = NULL;
393 sid = talloc(array, struct dom_sid);
395 status = NT_STATUS_NO_MEMORY;
398 sid_copy(sid, dom_list.domains[i].sid);
401 } while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES));
404 trusts->count = count;
405 trusts->array = talloc_move(mem_ctx, &array);
409 TALLOC_FREE(tmp_ctx);
413 /* Lookup group membership given a rid. */
414 static NTSTATUS sam_lookup_groupmem(struct winbindd_domain *domain,
416 const struct dom_sid *group_sid,
417 enum lsa_SidType type,
418 uint32_t *pnum_names,
419 struct dom_sid **psid_mem,
421 uint32_t **pname_types)
423 struct rpc_pipe_client *samr_pipe;
424 struct policy_handle dom_pol, group_pol;
425 uint32_t samr_access = SEC_FLAG_MAXIMUM_ALLOWED;
426 struct samr_RidTypeArray *rids = NULL;
428 uint32_t *rid_mem = NULL;
430 uint32_t num_names = 0;
431 uint32_t total_names = 0;
432 struct dom_sid *sid_mem = NULL;
434 uint32_t *name_types = NULL;
436 struct lsa_Strings tmp_names;
437 struct samr_Ids tmp_types;
443 DEBUG(3,("samr: lookup groupmem\n"));
449 if (!sid_peek_check_rid(&domain->sid, group_sid, &group_rid)) {
450 return NT_STATUS_UNSUCCESSFUL;
453 tmp_ctx = talloc_stackframe();
454 if (tmp_ctx == NULL) {
455 return NT_STATUS_NO_MEMORY;
458 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
459 if (!NT_STATUS_IS_OK(status)) {
463 status = rpccli_samr_OpenGroup(samr_pipe,
469 if (!NT_STATUS_IS_OK(status)) {
474 * Step #1: Get a list of user rids that are the members of the group.
476 status = rpccli_samr_QueryGroupMember(samr_pipe,
481 rpccli_samr_Close(samr_pipe, tmp_ctx, &group_pol);
483 if (!NT_STATUS_IS_OK(status)) {
487 if (rids == NULL || rids->count == 0) {
493 status = NT_STATUS_OK;
497 num_names = rids->count;
498 rid_mem = rids->rids;
501 * Step #2: Convert list of rids into list of usernames.
503 #define MAX_LOOKUP_RIDS 900
506 names = TALLOC_ZERO_ARRAY(tmp_ctx, char *, num_names);
507 name_types = TALLOC_ZERO_ARRAY(tmp_ctx, uint32_t, num_names);
508 sid_mem = TALLOC_ZERO_ARRAY(tmp_ctx, struct dom_sid, num_names);
509 if (names == NULL || name_types == NULL || sid_mem == NULL) {
510 status = NT_STATUS_NO_MEMORY;
515 for (j = 0; j < num_names; j++) {
516 sid_compose(&sid_mem[j], &domain->sid, rid_mem[j]);
519 status = rpccli_samr_LookupRids(samr_pipe,
526 if (!NT_STATUS_IS_OK(status)) {
527 if (!NT_STATUS_EQUAL(status, STATUS_SOME_UNMAPPED)) {
532 /* Copy result into array. The talloc system will take
533 care of freeing the temporary arrays later on. */
534 if (tmp_names.count != tmp_types.count) {
535 status = NT_STATUS_UNSUCCESSFUL;
539 for (r = 0; r < tmp_names.count; r++) {
540 if (tmp_types.ids[r] == SID_NAME_UNKNOWN) {
543 names[total_names] = fill_domain_username_talloc(names,
545 tmp_names.names[r].string,
547 name_types[total_names] = tmp_types.ids[r];
552 *pnum_names = total_names;
556 *pnames = talloc_move(mem_ctx, &names);
560 *pname_types = talloc_move(mem_ctx, &name_types);
564 *psid_mem = talloc_move(mem_ctx, &sid_mem);
568 TALLOC_FREE(tmp_ctx);
572 /*********************************************************************
573 BUILTIN specific functions.
574 *********************************************************************/
576 /* List all domain groups */
577 static NTSTATUS builtin_enum_dom_groups(struct winbindd_domain *domain,
580 struct acct_info **info)
582 /* BUILTIN doesn't have domain groups */
588 /* Query display info for a domain */
589 static NTSTATUS builtin_query_user_list(struct winbindd_domain *domain,
592 struct wbint_userinfo **info)
594 /* We don't have users */
600 /* Lookup user information from a rid or username. */
601 static NTSTATUS builtin_query_user(struct winbindd_domain *domain,
603 const struct dom_sid *user_sid,
604 struct wbint_userinfo *user_info)
606 return NT_STATUS_NO_SUCH_USER;
609 /* get a list of trusted domains - builtin domain */
610 static NTSTATUS builtin_trusted_domains(struct winbindd_domain *domain,
612 struct netr_DomainTrustList *trusts)
614 ZERO_STRUCTP(trusts);
618 /*********************************************************************
620 *********************************************************************/
622 /* List all local groups (aliases) */
623 static NTSTATUS sam_enum_local_groups(struct winbindd_domain *domain,
626 struct acct_info **pinfo)
628 struct rpc_pipe_client *samr_pipe;
629 struct policy_handle dom_pol;
630 struct acct_info *info = NULL;
631 uint32_t num_info = 0;
635 DEBUG(3,("samr: enum local groups\n"));
641 tmp_ctx = talloc_stackframe();
642 if (tmp_ctx == NULL) {
643 return NT_STATUS_NO_MEMORY;
646 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
647 if (!NT_STATUS_IS_OK(status)) {
651 status = rpc_enum_local_groups(mem_ctx,
656 if (!NT_STATUS_IS_OK(status)) {
661 *pnum_info = num_info;
665 *pinfo = talloc_move(mem_ctx, &info);
669 TALLOC_FREE(tmp_ctx);
673 /* convert a single name to a sid in a domain */
674 static NTSTATUS sam_name_to_sid(struct winbindd_domain *domain,
676 const char *domain_name,
679 struct dom_sid *psid,
680 enum lsa_SidType *ptype)
682 struct rpc_pipe_client *lsa_pipe;
683 struct policy_handle lsa_policy;
685 enum lsa_SidType type;
689 DEBUG(3,("sam_name_to_sid\n"));
691 tmp_ctx = talloc_stackframe();
692 if (tmp_ctx == NULL) {
693 return NT_STATUS_NO_MEMORY;
696 status = open_internal_lsa_conn(tmp_ctx, &lsa_pipe, &lsa_policy);
697 if (!NT_STATUS_IS_OK(status)) {
701 status = rpc_name_to_sid(tmp_ctx,
709 if (!NT_STATUS_IS_OK(status)) {
714 sid_copy(psid, &sid);
721 TALLOC_FREE(tmp_ctx);
725 /* convert a domain SID to a user or group name */
726 static NTSTATUS sam_sid_to_name(struct winbindd_domain *domain,
728 const struct dom_sid *sid,
731 enum lsa_SidType *ptype)
733 struct rpc_pipe_client *lsa_pipe;
734 struct policy_handle lsa_policy;
735 char *domain_name = NULL;
737 enum lsa_SidType type;
741 DEBUG(3,("sam_sid_to_name\n"));
744 if (!sid_check_is_in_builtin(sid) &&
745 !sid_check_is_in_our_domain(sid) &&
746 !sid_check_is_in_unix_users(sid) &&
747 !sid_check_is_unix_users(sid) &&
748 !sid_check_is_in_unix_groups(sid) &&
749 !sid_check_is_unix_groups(sid) &&
750 !sid_check_is_in_wellknown_domain(sid)) {
751 DEBUG(0, ("sam_sid_to_name: possible deadlock - trying to "
752 "lookup SID %s\n", sid_string_dbg(sid)));
753 return NT_STATUS_NONE_MAPPED;
756 tmp_ctx = talloc_stackframe();
757 if (tmp_ctx == NULL) {
758 return NT_STATUS_NO_MEMORY;
761 status = open_internal_lsa_conn(tmp_ctx, &lsa_pipe, &lsa_policy);
762 if (!NT_STATUS_IS_OK(status)) {
766 status = rpc_sid_to_name(tmp_ctx,
780 *pname = talloc_move(mem_ctx, &name);
784 *pdomain_name = talloc_move(mem_ctx, &domain_name);
788 TALLOC_FREE(tmp_ctx);
792 static NTSTATUS sam_rids_to_names(struct winbindd_domain *domain,
794 const struct dom_sid *sid,
799 enum lsa_SidType **ptypes)
801 struct rpc_pipe_client *lsa_pipe;
802 struct policy_handle lsa_policy;
803 enum lsa_SidType *types = NULL;
804 char *domain_name = NULL;
809 DEBUG(3,("sam_rids_to_names for %s\n", domain->name));
812 if (!sid_check_is_in_builtin(sid) &&
813 !sid_check_is_in_our_domain(sid) &&
814 !sid_check_is_in_unix_users(sid) &&
815 !sid_check_is_unix_users(sid) &&
816 !sid_check_is_in_unix_groups(sid) &&
817 !sid_check_is_unix_groups(sid) &&
818 !sid_check_is_in_wellknown_domain(sid)) {
819 DEBUG(0, ("sam_rids_to_names: possible deadlock - trying to "
820 "lookup SID %s\n", sid_string_dbg(sid)));
821 return NT_STATUS_NONE_MAPPED;
824 tmp_ctx = talloc_stackframe();
825 if (tmp_ctx == NULL) {
826 return NT_STATUS_NO_MEMORY;
829 status = open_internal_lsa_conn(tmp_ctx, &lsa_pipe, &lsa_policy);
830 if (!NT_STATUS_IS_OK(status)) {
834 status = rpc_rids_to_names(tmp_ctx,
844 if (!NT_STATUS_IS_OK(status)) {
849 *pdomain_name = talloc_move(mem_ctx, &domain_name);
853 *ptypes = talloc_move(mem_ctx, &types);
857 *pnames = talloc_move(mem_ctx, &names);
861 TALLOC_FREE(tmp_ctx);
865 static NTSTATUS common_lockout_policy(struct winbindd_domain *domain,
867 struct samr_DomInfo12 *lockout_policy)
869 struct rpc_pipe_client *samr_pipe;
870 struct policy_handle dom_pol;
871 union samr_DomainInfo *info = NULL;
875 DEBUG(3,("samr: lockout policy\n"));
877 tmp_ctx = talloc_stackframe();
878 if (tmp_ctx == NULL) {
879 return NT_STATUS_NO_MEMORY;
882 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
883 if (!NT_STATUS_IS_OK(status)) {
887 status = rpccli_samr_QueryDomainInfo(samr_pipe,
892 if (!NT_STATUS_IS_OK(status)) {
896 *lockout_policy = info->info12;
899 TALLOC_FREE(tmp_ctx);
903 static NTSTATUS common_password_policy(struct winbindd_domain *domain,
905 struct samr_DomInfo1 *passwd_policy)
907 struct rpc_pipe_client *samr_pipe;
908 struct policy_handle dom_pol;
909 union samr_DomainInfo *info = NULL;
913 DEBUG(3,("samr: password policy\n"));
915 tmp_ctx = talloc_stackframe();
916 if (tmp_ctx == NULL) {
917 return NT_STATUS_NO_MEMORY;
920 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
921 if (!NT_STATUS_IS_OK(status)) {
925 status = rpccli_samr_QueryDomainInfo(samr_pipe,
930 if (!NT_STATUS_IS_OK(status)) {
934 *passwd_policy = info->info1;
937 TALLOC_FREE(tmp_ctx);
941 /* Lookup groups a user is a member of. */
942 static NTSTATUS sam_lookup_usergroups(struct winbindd_domain *domain,
944 const struct dom_sid *user_sid,
945 uint32_t *pnum_groups,
946 struct dom_sid **puser_grpsids)
948 struct rpc_pipe_client *samr_pipe;
949 struct policy_handle dom_pol;
950 struct dom_sid *user_grpsids = NULL;
951 uint32_t num_groups = 0;
955 DEBUG(3,("sam_lookup_usergroups\n"));
961 tmp_ctx = talloc_stackframe();
962 if (tmp_ctx == NULL) {
963 return NT_STATUS_NO_MEMORY;
966 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
967 if (!NT_STATUS_IS_OK(status)) {
971 status = rpc_lookup_usergroups(tmp_ctx,
978 if (!NT_STATUS_IS_OK(status)) {
983 *pnum_groups = num_groups;
987 *puser_grpsids = talloc_move(mem_ctx, &user_grpsids);
991 TALLOC_FREE(tmp_ctx);
995 static NTSTATUS sam_lookup_useraliases(struct winbindd_domain *domain,
998 const struct dom_sid *sids,
999 uint32_t *pnum_aliases,
1000 uint32_t **palias_rids)
1002 struct rpc_pipe_client *samr_pipe;
1003 struct policy_handle dom_pol;
1004 uint32_t num_aliases = 0;
1005 uint32_t *alias_rids = NULL;
1006 TALLOC_CTX *tmp_ctx;
1009 DEBUG(3,("sam_lookup_useraliases\n"));
1015 tmp_ctx = talloc_stackframe();
1016 if (tmp_ctx == NULL) {
1017 return NT_STATUS_NO_MEMORY;
1020 status = open_internal_samr_conn(tmp_ctx, domain, &samr_pipe, &dom_pol);
1021 if (!NT_STATUS_IS_OK(status)) {
1025 status = rpc_lookup_useraliases(tmp_ctx,
1032 if (!NT_STATUS_IS_OK(status)) {
1037 *pnum_aliases = num_aliases;
1041 *palias_rids = talloc_move(mem_ctx, &alias_rids);
1045 TALLOC_FREE(tmp_ctx);
1049 /* find the sequence number for a domain */
1050 static NTSTATUS common_sequence_number(struct winbindd_domain *domain,
1053 struct rpc_pipe_client *samr_pipe;
1054 struct policy_handle dom_pol;
1055 union samr_DomainInfo *info = NULL;
1056 bool got_seq_num = false;
1057 TALLOC_CTX *mem_ctx;
1060 DEBUG(3,("samr: sequence number\n"));
1062 mem_ctx = talloc_init("common_sequence_number");
1063 if (mem_ctx == NULL) {
1064 return NT_STATUS_NO_MEMORY;
1068 *seq = DOM_SEQUENCE_NONE;
1071 status = open_internal_samr_conn(mem_ctx, domain, &samr_pipe, &dom_pol);
1072 if (!NT_STATUS_IS_OK(status)) {
1076 /* query domain info */
1077 status = rpccli_samr_QueryDomainInfo(samr_pipe,
1082 if (NT_STATUS_IS_OK(status)) {
1084 *seq = info->info8.sequence_num;
1090 /* retry with info-level 2 in case the dc does not support info-level 8
1091 * (like all older samba2 and samba3 dc's) - Guenther */
1092 status = rpccli_samr_QueryDomainInfo(samr_pipe,
1097 if (NT_STATUS_IS_OK(status)) {
1099 *seq = info->general.sequence_num;
1106 DEBUG(10,("domain_sequence_number: for domain %s is %u\n",
1107 domain->name, (unsigned)*seq));
1109 DEBUG(10,("domain_sequence_number: failed to get sequence "
1110 "number (%u) for domain %s\n",
1111 (unsigned) *seq, domain->name ));
1112 status = NT_STATUS_OK;
1116 talloc_destroy(mem_ctx);
1120 /* the rpc backend methods are exposed via this structure */
1121 struct winbindd_methods builtin_passdb_methods = {
1122 .consistent = false,
1124 .query_user_list = builtin_query_user_list,
1125 .enum_dom_groups = builtin_enum_dom_groups,
1126 .enum_local_groups = sam_enum_local_groups,
1127 .name_to_sid = sam_name_to_sid,
1128 .sid_to_name = sam_sid_to_name,
1129 .rids_to_names = sam_rids_to_names,
1130 .query_user = builtin_query_user,
1131 .lookup_usergroups = sam_lookup_usergroups,
1132 .lookup_useraliases = sam_lookup_useraliases,
1133 .lookup_groupmem = sam_lookup_groupmem,
1134 .sequence_number = common_sequence_number,
1135 .lockout_policy = common_lockout_policy,
1136 .password_policy = common_password_policy,
1137 .trusted_domains = builtin_trusted_domains
1140 /* the rpc backend methods are exposed via this structure */
1141 struct winbindd_methods sam_passdb_methods = {
1142 .consistent = false,
1144 .query_user_list = sam_query_user_list,
1145 .enum_dom_groups = sam_enum_dom_groups,
1146 .enum_local_groups = sam_enum_local_groups,
1147 .name_to_sid = sam_name_to_sid,
1148 .sid_to_name = sam_sid_to_name,
1149 .rids_to_names = sam_rids_to_names,
1150 .query_user = sam_query_user,
1151 .lookup_usergroups = sam_lookup_usergroups,
1152 .lookup_useraliases = sam_lookup_useraliases,
1153 .lookup_groupmem = sam_lookup_groupmem,
1154 .sequence_number = common_sequence_number,
1155 .lockout_policy = common_lockout_policy,
1156 .password_policy = common_password_policy,
1157 .trusted_domains = sam_trusted_domains