2 * Unix SMB/CIFS implementation.
4 * LSARPC client routines
6 * Copyright (c) 2000-2001 Tim Potter
7 * Copyright (c) 1992-2000 Andrew Tridgell
8 * Copyright (c) 2002 Rafal Szczesniak
9 * Copyright (c) 2005 Jeremy Allison
10 * Copyright (c) 2007 Michael Adam
11 * Copyright (c) 2008 Guenther Deschner
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, see <http://www.gnu.org/licenses/>.
30 /* The following definitions come from rpc_client/cli_lsarpc.c */
32 struct rpc_pipe_client;
35 * @brief Open a LSA policy.
37 * @param[in] h The dcerpc binding hanlde to use.
39 * @param[in] mem_ctx The memory context to use.
41 * @param[in] sec_qos Enable security quality of services.
43 * @param[in] des_access The disired access rights to be granted.
45 * @param[out] pol A pointer to a rpc policy handle.
47 * @param[out] result A pointer for the NDR NTSTATUS error code.
49 * @return A corresponding NTSTATUS error code for the connection.
51 NTSTATUS dcerpc_lsa_open_policy(struct dcerpc_binding_handle *h,
55 struct policy_handle *pol,
57 NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
59 bool sec_qos, uint32_t des_access,
60 struct policy_handle *pol);
63 * @brief Open a LSA policy.
65 * @param[in] h The dcerpc binding hanlde to use.
67 * @param[in] mem_ctx The memory context to use.
69 * @param[in] sec_qos Enable security quality of services.
71 * @param[in] des_access The disired access rights to be granted.
73 * @param[out] pol A pointer to a rpc policy handle.
75 * @param[out] result A pointer for the NDR NTSTATUS error code.
77 * @return A corresponding NTSTATUS error code for the connection.
79 NTSTATUS dcerpc_lsa_open_policy2(struct dcerpc_binding_handle *h,
81 const char *srv_name_slash,
84 struct policy_handle *pol,
86 NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
87 TALLOC_CTX *mem_ctx, bool sec_qos,
88 uint32_t des_access, struct policy_handle *pol);
91 * @brief Look up the names that correspond to an array of sids.
93 * @param[in] h The initialized binding handle for a dcerpc connection.
95 * @param[in] mem_ctx The memory context to use.
97 * @param[in] pol The opened domain policy handle.
99 * @param[in] num_sids The number of sids in the sids array to look up.
101 * @param[in] sids The array of sids to look up.
103 * @param[out] pdomains A pointer to store the refercenced domains.
105 * @param[out] pnames A pointer to an array for the translated names.
107 * @param[out] ptypes A pointer to an array for the types of the names.
109 * @param[out] result A pointer for the conversion result.
111 * @return A corresponding NTSTATUS error code.
113 NTSTATUS dcerpc_lsa_lookup_sids(struct dcerpc_binding_handle *h,
115 struct policy_handle *pol,
117 const struct dom_sid *sids,
120 enum lsa_SidType **ptypes,
122 NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli,
124 struct policy_handle *pol,
126 const struct dom_sid *sids,
129 enum lsa_SidType **ptypes);
130 NTSTATUS dcerpc_lsa_lookup_sids_generic(struct dcerpc_binding_handle *h,
132 struct policy_handle *pol,
134 const struct dom_sid *sids,
135 enum lsa_LookupNamesLevel level,
138 enum lsa_SidType **ptypes,
139 bool use_lookupsids3,
142 * @brief Look up the names that correspond to an array of sids.
144 * @param[in] h The initialized binding handle for a dcerpc connection.
146 * @param[in] mem_ctx The memory context to use.
148 * @param[in] pol The opened domain policy handle.
150 * @param[in] num_sids The number of sids in the sids array to look up.
152 * @param[in] sids The array of sids to look up.
154 * @param[out] pdomains A pointer to store the refercenced domains.
156 * @param[out] pnames A pointer to an array for the translated names.
158 * @param[out] ptypes A pointer to an array for the types of the names.
160 * @param[out] result A pointer for the conversion result.
162 * @return A corresponding NTSTATUS error code.
164 NTSTATUS dcerpc_lsa_lookup_sids3(struct dcerpc_binding_handle *h,
166 struct policy_handle *pol,
168 const struct dom_sid *sids,
171 enum lsa_SidType **ptypes,
173 NTSTATUS dcerpc_lsa_lookup_names(struct dcerpc_binding_handle *h,
175 struct policy_handle *pol,
178 const char ***dom_names,
179 enum lsa_LookupNamesLevel level,
180 struct dom_sid **sids,
181 enum lsa_SidType **types,
183 NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
185 struct policy_handle *pol, int num_names,
187 const char ***dom_names,
189 struct dom_sid **sids,
190 enum lsa_SidType **types);
192 NTSTATUS dcerpc_lsa_lookup_names4(struct dcerpc_binding_handle *h,
194 struct policy_handle *pol,
197 const char ***dom_names,
198 enum lsa_LookupNamesLevel level,
199 struct dom_sid **sids,
200 enum lsa_SidType **types,
202 NTSTATUS dcerpc_lsa_lookup_names_generic(struct dcerpc_binding_handle *h,
204 struct policy_handle *pol,
207 const char ***dom_names,
208 enum lsa_LookupNamesLevel level,
209 struct dom_sid **sids,
210 enum lsa_SidType **types,
211 bool use_lookupnames4,
214 bool fetch_domain_sid( char *domain, char *remote_machine, struct dom_sid *psid);
216 #endif /* _CLI_LSARPC_H */