s3-passdb: Respect LOOKUP_NAME_GROUP flag in sid lookup.
[Samba.git] / source3 / winbindd / winbindd_rpc.h
blob5513788ec8dd215c6679818a7e72e4af8ae1087d
1 /*
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/>.
26 #ifndef _WINBINDD_RPC_H_
27 #define _WINBINDD_RPC_H_
29 /* Query display info for a domain */
30 NTSTATUS rpc_query_user_list(TALLOC_CTX *mem_ctx,
31 struct rpc_pipe_client *samr_pipe,
32 struct policy_handle *samr_policy,
33 const struct dom_sid *domain_sid,
34 uint32_t *pnum_info,
35 struct wbint_userinfo **pinfo);
37 NTSTATUS rpc_enum_dom_groups(TALLOC_CTX *mem_ctx,
38 struct rpc_pipe_client *samr_pipe,
39 struct policy_handle *sam_policy,
40 uint32_t *pnum_info,
41 struct wb_acct_info **pinfo);
43 /* List all domain groups */
44 NTSTATUS rpc_enum_local_groups(TALLOC_CTX *mem_ctx,
45 struct rpc_pipe_client *samr_pipe,
46 struct policy_handle *samr_policy,
47 uint32_t *pnum_info,
48 struct wb_acct_info **pinfo);
50 /* Convert a single name to a sid in a domain */
51 NTSTATUS rpc_name_to_sid(TALLOC_CTX *mem_ctx,
52 struct rpc_pipe_client *lsa_pipe,
53 struct policy_handle *lsa_policy,
54 const char *domain_name,
55 const char *name,
56 uint32_t flags,
57 struct dom_sid *psid,
58 enum lsa_SidType *ptype);
60 /* Convert a domain SID to a user or group name */
61 NTSTATUS rpc_sid_to_name(TALLOC_CTX *mem_ctx,
62 struct rpc_pipe_client *lsa_pipe,
63 struct policy_handle *lsa_policy,
64 struct winbindd_domain *domain,
65 const struct dom_sid *sid,
66 char **pdomain_name,
67 char **pname,
68 enum lsa_SidType *ptype);
70 /* Convert a bunch of rids to user or group names */
71 NTSTATUS rpc_rids_to_names(TALLOC_CTX *mem_ctx,
72 struct rpc_pipe_client *lsa_pipe,
73 struct policy_handle *lsa_policy,
74 struct winbindd_domain *domain,
75 const struct dom_sid *sid,
76 uint32_t *rids,
77 size_t num_rids,
78 char **pdomain_name,
79 char ***pnames,
80 enum lsa_SidType **ptypes);
82 /* Lookup user information from a rid or username. */
83 NTSTATUS rpc_query_user(TALLOC_CTX *mem_ctx,
84 struct rpc_pipe_client *samr_pipe,
85 struct policy_handle *samr_policy,
86 const struct dom_sid *domain_sid,
87 const struct dom_sid *user_sid,
88 struct wbint_userinfo *user_info);
90 /* Lookup groups a user is a member of. */
91 NTSTATUS rpc_lookup_usergroups(TALLOC_CTX *mem_ctx,
92 struct rpc_pipe_client *samr_pipe,
93 struct policy_handle *samr_policy,
94 const struct dom_sid *domain_sid,
95 const struct dom_sid *user_sid,
96 uint32_t *pnum_groups,
97 struct dom_sid **puser_grpsids);
99 NTSTATUS rpc_lookup_useraliases(TALLOC_CTX *mem_ctx,
100 struct rpc_pipe_client *samr_pipe,
101 struct policy_handle *samr_policy,
102 uint32_t num_sids,
103 const struct dom_sid *sids,
104 uint32_t *pnum_aliases,
105 uint32_t **palias_rids);
107 /* Lookup group membership given a rid. */
108 NTSTATUS rpc_lookup_groupmem(TALLOC_CTX *mem_ctx,
109 struct rpc_pipe_client *samr_pipe,
110 struct policy_handle *samr_policy,
111 const char *domain_name,
112 const struct dom_sid *domain_sid,
113 const struct dom_sid *group_sid,
114 enum lsa_SidType type,
115 uint32_t *pnum_names,
116 struct dom_sid **psid_mem,
117 char ***pnames,
118 uint32_t **pname_types);
120 /* Find the sequence number for a domain */
121 NTSTATUS rpc_sequence_number(TALLOC_CTX *mem_ctx,
122 struct rpc_pipe_client *samr_pipe,
123 struct policy_handle *samr_policy,
124 const char *domain_name,
125 uint32_t *pseq);
127 /* Get a list of trusted domains */
128 NTSTATUS rpc_trusted_domains(TALLOC_CTX *mem_ctx,
129 struct rpc_pipe_client *lsa_pipe,
130 struct policy_handle *lsa_policy,
131 uint32_t *pnum_trusts,
132 struct netr_DomainTrust **ptrusts);
134 #endif /* _WINBINDD_RPC_H_ */