1 | /*
|
---|
2 | * Unix SMB/CIFS implementation.
|
---|
3 | *
|
---|
4 | * LSARPC client routines
|
---|
5 | *
|
---|
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
|
---|
12 | *
|
---|
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.
|
---|
17 | *
|
---|
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.
|
---|
22 | *
|
---|
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/>.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef _CLI_LSARPC_H
|
---|
28 | #define _CLI_LSARPC_H
|
---|
29 |
|
---|
30 | /* The following definitions come from rpc_client/cli_lsarpc.c */
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * @brief Open a LSA policy.
|
---|
34 | *
|
---|
35 | * @param[in] h The dcerpc binding hanlde to use.
|
---|
36 | *
|
---|
37 | * @param[in] mem_ctx The memory context to use.
|
---|
38 | *
|
---|
39 | * @param[in] sec_qos Enable security quality of services.
|
---|
40 | *
|
---|
41 | * @param[in] des_access The disired access rights to be granted.
|
---|
42 | *
|
---|
43 | * @param[out] pol A pointer to a rpc policy handle.
|
---|
44 | *
|
---|
45 | * @param[out] result A pointer for the NDR NTSTATUS error code.
|
---|
46 | *
|
---|
47 | * @return A corresponding NTSTATUS error code for the connection.
|
---|
48 | */
|
---|
49 | NTSTATUS dcerpc_lsa_open_policy(struct dcerpc_binding_handle *h,
|
---|
50 | TALLOC_CTX *mem_ctx,
|
---|
51 | bool sec_qos,
|
---|
52 | uint32_t des_access,
|
---|
53 | struct policy_handle *pol,
|
---|
54 | NTSTATUS *result);
|
---|
55 | NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
|
---|
56 | TALLOC_CTX *mem_ctx,
|
---|
57 | bool sec_qos, uint32 des_access,
|
---|
58 | struct policy_handle *pol);
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * @brief Open a LSA policy.
|
---|
62 | *
|
---|
63 | * @param[in] h The dcerpc binding hanlde to use.
|
---|
64 | *
|
---|
65 | * @param[in] mem_ctx The memory context to use.
|
---|
66 | *
|
---|
67 | * @param[in] sec_qos Enable security quality of services.
|
---|
68 | *
|
---|
69 | * @param[in] des_access The disired access rights to be granted.
|
---|
70 | *
|
---|
71 | * @param[out] pol A pointer to a rpc policy handle.
|
---|
72 | *
|
---|
73 | * @param[out] result A pointer for the NDR NTSTATUS error code.
|
---|
74 | *
|
---|
75 | * @return A corresponding NTSTATUS error code for the connection.
|
---|
76 | */
|
---|
77 | NTSTATUS dcerpc_lsa_open_policy2(struct dcerpc_binding_handle *h,
|
---|
78 | TALLOC_CTX *mem_ctx,
|
---|
79 | const char *srv_name_slash,
|
---|
80 | bool sec_qos,
|
---|
81 | uint32_t des_access,
|
---|
82 | struct policy_handle *pol,
|
---|
83 | NTSTATUS *result);
|
---|
84 | NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
|
---|
85 | TALLOC_CTX *mem_ctx, bool sec_qos,
|
---|
86 | uint32 des_access, struct policy_handle *pol);
|
---|
87 |
|
---|
88 | /**
|
---|
89 | * @brief Look up the names that correspond to an array of sids.
|
---|
90 | *
|
---|
91 | * @param[in] h The initialized binding handle for a dcerpc connection.
|
---|
92 | *
|
---|
93 | * @param[in] mem_ctx The memory context to use.
|
---|
94 | *
|
---|
95 | * @param[in] pol The opened domain policy handle.
|
---|
96 | *
|
---|
97 | * @param[in] num_sids The number of sids in the sids array to look up.
|
---|
98 | *
|
---|
99 | * @param[in] sids The array of sids to look up.
|
---|
100 | *
|
---|
101 | * @param[out] pdomains A pointer to store the refercenced domains.
|
---|
102 | *
|
---|
103 | * @param[out] pnames A pointer to an array for the translated names.
|
---|
104 | *
|
---|
105 | * @param[out] ptypes A pointer to an array for the types of the names.
|
---|
106 | *
|
---|
107 | * @param[out] result A pointer for the conversion result.
|
---|
108 | *
|
---|
109 | * @return A corresponding NTSTATUS error code.
|
---|
110 | */
|
---|
111 | NTSTATUS dcerpc_lsa_lookup_sids(struct dcerpc_binding_handle *h,
|
---|
112 | TALLOC_CTX *mem_ctx,
|
---|
113 | struct policy_handle *pol,
|
---|
114 | int num_sids,
|
---|
115 | const struct dom_sid *sids,
|
---|
116 | char ***pdomains,
|
---|
117 | char ***pnames,
|
---|
118 | enum lsa_SidType **ptypes,
|
---|
119 | NTSTATUS *result);
|
---|
120 | NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli,
|
---|
121 | TALLOC_CTX *mem_ctx,
|
---|
122 | struct policy_handle *pol,
|
---|
123 | int num_sids,
|
---|
124 | const struct dom_sid *sids,
|
---|
125 | char ***pdomains,
|
---|
126 | char ***pnames,
|
---|
127 | enum lsa_SidType **ptypes);
|
---|
128 | NTSTATUS dcerpc_lsa_lookup_sids_generic(struct dcerpc_binding_handle *h,
|
---|
129 | TALLOC_CTX *mem_ctx,
|
---|
130 | struct policy_handle *pol,
|
---|
131 | int num_sids,
|
---|
132 | const struct dom_sid *sids,
|
---|
133 | char ***pdomains,
|
---|
134 | char ***pnames,
|
---|
135 | enum lsa_SidType **ptypes,
|
---|
136 | bool use_lookupsids3,
|
---|
137 | NTSTATUS *presult);
|
---|
138 | /**
|
---|
139 | * @brief Look up the names that correspond to an array of sids.
|
---|
140 | *
|
---|
141 | * @param[in] h The initialized binding handle for a dcerpc connection.
|
---|
142 | *
|
---|
143 | * @param[in] mem_ctx The memory context to use.
|
---|
144 | *
|
---|
145 | * @param[in] pol The opened domain policy handle.
|
---|
146 | *
|
---|
147 | * @param[in] num_sids The number of sids in the sids array to look up.
|
---|
148 | *
|
---|
149 | * @param[in] sids The array of sids to look up.
|
---|
150 | *
|
---|
151 | * @param[out] pdomains A pointer to store the refercenced domains.
|
---|
152 | *
|
---|
153 | * @param[out] pnames A pointer to an array for the translated names.
|
---|
154 | *
|
---|
155 | * @param[out] ptypes A pointer to an array for the types of the names.
|
---|
156 | *
|
---|
157 | * @param[out] result A pointer for the conversion result.
|
---|
158 | *
|
---|
159 | * @return A corresponding NTSTATUS error code.
|
---|
160 | */
|
---|
161 | NTSTATUS dcerpc_lsa_lookup_sids3(struct dcerpc_binding_handle *h,
|
---|
162 | TALLOC_CTX *mem_ctx,
|
---|
163 | struct policy_handle *pol,
|
---|
164 | int num_sids,
|
---|
165 | const struct dom_sid *sids,
|
---|
166 | char ***pdomains,
|
---|
167 | char ***pnames,
|
---|
168 | enum lsa_SidType **ptypes,
|
---|
169 | NTSTATUS *result);
|
---|
170 | NTSTATUS dcerpc_lsa_lookup_names(struct dcerpc_binding_handle *h,
|
---|
171 | TALLOC_CTX *mem_ctx,
|
---|
172 | struct policy_handle *pol,
|
---|
173 | uint32_t num_names,
|
---|
174 | const char **names,
|
---|
175 | const char ***dom_names,
|
---|
176 | enum lsa_LookupNamesLevel level,
|
---|
177 | struct dom_sid **sids,
|
---|
178 | enum lsa_SidType **types,
|
---|
179 | NTSTATUS *result);
|
---|
180 | NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
|
---|
181 | TALLOC_CTX *mem_ctx,
|
---|
182 | struct policy_handle *pol, int num_names,
|
---|
183 | const char **names,
|
---|
184 | const char ***dom_names,
|
---|
185 | int level,
|
---|
186 | struct dom_sid **sids,
|
---|
187 | enum lsa_SidType **types);
|
---|
188 |
|
---|
189 | NTSTATUS dcerpc_lsa_lookup_names4(struct dcerpc_binding_handle *h,
|
---|
190 | TALLOC_CTX *mem_ctx,
|
---|
191 | struct policy_handle *pol,
|
---|
192 | uint32_t num_names,
|
---|
193 | const char **names,
|
---|
194 | const char ***dom_names,
|
---|
195 | enum lsa_LookupNamesLevel level,
|
---|
196 | struct dom_sid **sids,
|
---|
197 | enum lsa_SidType **types,
|
---|
198 | NTSTATUS *result);
|
---|
199 | NTSTATUS dcerpc_lsa_lookup_names_generic(struct dcerpc_binding_handle *h,
|
---|
200 | TALLOC_CTX *mem_ctx,
|
---|
201 | struct policy_handle *pol,
|
---|
202 | uint32_t num_names,
|
---|
203 | const char **names,
|
---|
204 | const char ***dom_names,
|
---|
205 | enum lsa_LookupNamesLevel level,
|
---|
206 | struct dom_sid **sids,
|
---|
207 | enum lsa_SidType **types,
|
---|
208 | bool use_lookupnames4,
|
---|
209 | NTSTATUS *presult);
|
---|
210 |
|
---|
211 | bool fetch_domain_sid( char *domain, char *remote_machine, struct dom_sid *psid);
|
---|
212 |
|
---|
213 | #endif /* _CLI_LSARPC_H */
|
---|