util:datablob: data_blob_pad checks its alignment assumption
[samba.git] / source3 / rpc_client / cli_samr.h
blob5a4f39cefcecd1375f8834fb29091a32d1ad9e8c
1 /*
2 * Unix SMB/CIFS implementation.
4 * SAMR 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/>.
27 #ifndef _CLI_SAMR_H
28 #define _CLI_SAMR_H
30 /* The following definitions come from rpc_client/cli_samr.c */
32 /**
33 * @brief Change the password of a user.
35 * @param[in] h The dcerpc binding handle to use.
37 * @param[in] mem_ctx The memory context to use.
39 * @param[in] user_handle The password of the user to chang the handle
41 * @param[in] newpassword The new password to set.
43 * @param[in] oldpassword The old password for verification
45 * @param[out] presult A pointer for the NDR NTSTATUS error code.
47 * @return A corresponding NTSTATUS error code for the connection.
49 NTSTATUS dcerpc_samr_chgpasswd_user(struct dcerpc_binding_handle *h,
50 TALLOC_CTX *mem_ctx,
51 struct policy_handle *user_handle,
52 const char *newpassword,
53 const char *oldpassword,
54 NTSTATUS *presult);
56 NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
57 TALLOC_CTX *mem_ctx,
58 struct policy_handle *user_handle,
59 const char *newpassword,
60 const char *oldpassword);
62 /**
63 * @brief Change the password of a user based on username.
65 * @param[in] h The dcerpc binding handle to use.
67 * @param[in] mem_ctx The memory context to use.
69 * @param[in] srv_name_slash The server name with leading slashes.
71 * @param[in] username The name of the user.
73 * @param[in] newpassword The new password to set.
75 * @param[in] oldpassword The old password for verification
77 * @param[out] presult A pointer for the NDR NTSTATUS error code.
79 * @return A corresponding NTSTATUS error code for the connection.
81 NTSTATUS dcerpc_samr_chgpasswd_user2(struct dcerpc_binding_handle *h,
82 TALLOC_CTX *mem_ctx,
83 const char *srv_name_slash,
84 const char *username,
85 const char *newpassword,
86 const char *oldpassword,
87 NTSTATUS *presult);
89 NTSTATUS rpccli_samr_chgpasswd_user2(struct rpc_pipe_client *cli,
90 TALLOC_CTX *mem_ctx,
91 const char *username,
92 const char *newpassword,
93 const char *oldpassword);
95 /**
96 * @brief Change the password of a user based on the user name given and using
97 * blobs.
99 * @param[in] h The dcerpc binding handle to use.
101 * @param[in] mem_ctx The memory context to use.
103 * @param[in] srv_name_slash The server name with leading slashes.
105 * @param[in] username The name of the user.
107 * @param[in] new_nt_password_blob The new password as a encrypted blob.
109 * @param[in] old_nt_hash_enc_blob The old password as a hash encoded blob.
111 * @param[in] new_lm_password_blob The new password as a lanman encoded blob.
113 * @param[in] old_lm_hash_enc_blob The old password as a lanman encoded blob.
115 * @param[out] presult A pointer for the NDR NTSTATUS error code.
117 * @return A corresponding NTSTATUS error code for the connection.
119 NTSTATUS dcerpc_samr_chng_pswd_auth_crap(struct dcerpc_binding_handle *h,
120 TALLOC_CTX *mem_ctx,
121 const char *srv_name_slash,
122 const char *username,
123 DATA_BLOB new_nt_password_blob,
124 DATA_BLOB old_nt_hash_enc_blob,
125 DATA_BLOB new_lm_password_blob,
126 DATA_BLOB old_lm_hash_enc_blob,
127 NTSTATUS *presult);
129 NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli,
130 TALLOC_CTX *mem_ctx,
131 const char *username,
132 DATA_BLOB new_nt_password_blob,
133 DATA_BLOB old_nt_hash_enc_blob,
134 DATA_BLOB new_lm_password_blob,
135 DATA_BLOB old_lm_hash_enc_blob);
138 * @brief
140 * @param[in] h The dcerpc binding handle to use.
142 * @param[in] mem_ctx The memory context to use.
144 * @param[in] srv_name_slash The server name with leading slashes.
146 * @param[in] username The name of the user.
148 * @param[in] newpassword The new password to set.
150 * @param[in] oldpassword The old password to set.
152 * @param[in] dominfo1 A pointer to hold the domain information.
154 * @param[in] reject A pointer to store the result of a possible reject.
156 * @param[out] presult A pointer for the NDR NTSTATUS error code.
158 * @return A corresponding NTSTATUS error code for the connection.
160 NTSTATUS dcerpc_samr_chgpasswd_user3(struct dcerpc_binding_handle *h,
161 TALLOC_CTX *mem_ctx,
162 const char *srv_name_slash,
163 const char *username,
164 const char *newpassword,
165 const char *oldpassword,
166 struct samr_DomInfo1 **dominfo1,
167 struct userPwdChangeFailureInformation **reject,
168 NTSTATUS *presult);
170 NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli,
171 TALLOC_CTX *mem_ctx,
172 const char *username,
173 const char *newpassword,
174 const char *oldpassword,
175 struct samr_DomInfo1 **dominfo1,
176 struct userPwdChangeFailureInformation **reject);
178 NTSTATUS dcerpc_samr_chgpasswd_user4(struct dcerpc_binding_handle *h,
179 TALLOC_CTX *mem_ctx,
180 const char *srv_name_slash,
181 const char *username,
182 const char *oldpassword,
183 const char *newpassword,
184 NTSTATUS *presult);
187 * @brief Create a set of max_entries, max_size for QueryDisplayInfo.
189 * This function returns a set of (max_entries, max_size) required
190 * for the QueryDisplayInfo RPC to actually work against a domain controller
191 * with large (10k and higher) numbers of users. These values were
192 * obtained by inspection using wireshark and NT4 running User Manager.
194 * @param[in] loop_count The loop count.
196 * @param[out] max_entries A pointer to store maximum entries value.
198 * @param[out] max_size A pointer to store the maximum size value.
200 void dcerpc_get_query_dispinfo_params(int loop_count,
201 uint32_t *max_entries,
202 uint32_t *max_size);
205 * @brief Try if we can connect to samr.
207 * @param[in] h The dcerpc binding handle to use.
209 * @param[in] mem_ctx The memory context to use.
211 * @param[in] srv_name_slash The server name with leading slashes.
213 * @param[in] access_mask The access mask to use to open the connection.
215 * @param[in] connect_pol A pointer to store the policy handle for the
216 * connection.
218 * @param[out] presult A pointer for the NDR NTSTATUS error code.
220 * @return A corresponding NTSTATUS error code for the connection.
222 NTSTATUS dcerpc_try_samr_connects(struct dcerpc_binding_handle *h,
223 TALLOC_CTX *mem_ctx,
224 const char *srv_name_slash,
225 uint32_t access_mask,
226 struct policy_handle *connect_pol,
227 NTSTATUS *presult);
229 #endif /* _CLI_SAMR_H */