s3-rpc_client: Added dcerpc_samr_chgpasswd_user.
[kai/samba.git] / source3 / rpc_client / cli_samr.h
1 /*
2  *  Unix SMB/CIFS implementation.
3  *
4  *  SAMR 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_SAMR_H
28 #define _CLI_SAMR_H
29
30 /* The following definitions come from rpc_client/cli_samr.c  */
31
32 /**
33  * @brief Change the password of a user.
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]  user_handle The password of the user to chang the handle
40  *
41  * @param[in]  newpassword The new password to set.
42  *
43  * @param[in]  oldpassword The old password for verification
44  *
45  * @param[out] presult  A pointer for the NDR NTSTATUS error code.
46  *
47  * @return              A corresponding NTSTATUS error code for the connection.
48  */
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);
55
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);
61 NTSTATUS rpccli_samr_chgpasswd_user2(struct rpc_pipe_client *cli,
62                                      TALLOC_CTX *mem_ctx,
63                                      const char *username,
64                                      const char *newpassword,
65                                      const char *oldpassword);
66 NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli,
67                                          TALLOC_CTX *mem_ctx,
68                                          const char *username,
69                                          DATA_BLOB new_nt_password_blob,
70                                          DATA_BLOB old_nt_hash_enc_blob,
71                                          DATA_BLOB new_lm_password_blob,
72                                          DATA_BLOB old_lm_hash_enc_blob);
73 NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli,
74                                      TALLOC_CTX *mem_ctx,
75                                      const char *username,
76                                      const char *newpassword,
77                                      const char *oldpassword,
78                                      struct samr_DomInfo1 **dominfo1,
79                                      struct userPwdChangeFailureInformation **reject);
80 void get_query_dispinfo_params(int loop_count, uint32 *max_entries,
81                                uint32 *max_size);
82 NTSTATUS rpccli_try_samr_connects(struct rpc_pipe_client *cli,
83                                   TALLOC_CTX *mem_ctx,
84                                   uint32_t access_mask,
85                                   struct policy_handle *connect_pol);
86
87 #endif /* _CLI_SAMR_H */