f992e2b908263e5d6f879392552bf56293ff9ee3
[metze/samba/wip.git] / source3 / rpc_server / samr / srv_samr_util.h
1 /*
2    Unix SMB/CIFS implementation.
3    SAMR Pipe utility functions.
4
5    Copyright (C) Luke Kenneth Casson Leighton   1996-1998
6    Copyright (C) Gerald (Jerry) Carter          2000-2001
7    Copyright (C) Andrew Bartlett                2001-2002
8    Copyright (C) Stefan (metze) Metzmacher      2002
9    Copyright (C) Guenther Deschner              2008
10
11    This program is free software; you can redistribute it and/or modify
12    it under the terms of the GNU General Public License as published by
13    the Free Software Foundation; either version 3 of the License, or
14    (at your option) any later version.
15
16    This program is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19    GNU General Public License for more details.
20
21    You should have received a copy of the GNU General Public License
22    along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 */
24
25 /* The following definitions come from rpc_server/srv_samr_util.c  */
26
27 struct samu;
28
29 void copy_id2_to_sam_passwd(struct samu *to,
30                             struct samr_UserInfo2 *from);
31 void copy_id4_to_sam_passwd(struct samu *to,
32                             struct samr_UserInfo4 *from);
33 void copy_id6_to_sam_passwd(struct samu *to,
34                             struct samr_UserInfo6 *from);
35 void copy_id8_to_sam_passwd(struct samu *to,
36                             struct samr_UserInfo8 *from);
37 void copy_id10_to_sam_passwd(struct samu *to,
38                              struct samr_UserInfo10 *from);
39 void copy_id11_to_sam_passwd(struct samu *to,
40                              struct samr_UserInfo11 *from);
41 void copy_id12_to_sam_passwd(struct samu *to,
42                              struct samr_UserInfo12 *from);
43 void copy_id13_to_sam_passwd(struct samu *to,
44                              struct samr_UserInfo13 *from);
45 void copy_id14_to_sam_passwd(struct samu *to,
46                              struct samr_UserInfo14 *from);
47 void copy_id16_to_sam_passwd(struct samu *to,
48                              struct samr_UserInfo16 *from);
49 void copy_id17_to_sam_passwd(struct samu *to,
50                              struct samr_UserInfo17 *from);
51 void copy_id18_to_sam_passwd(struct samu *to,
52                              struct samr_UserInfo18 *from);
53 void copy_id20_to_sam_passwd(struct samu *to,
54                              struct samr_UserInfo20 *from);
55 void copy_id21_to_sam_passwd(const char *log_prefix,
56                              struct samu *to,
57                              struct samr_UserInfo21 *from);
58 void copy_id23_to_sam_passwd(struct samu *to,
59                              struct samr_UserInfo23 *from);
60 void copy_id24_to_sam_passwd(struct samu *to,
61                              struct samr_UserInfo24 *from);
62 void copy_id25_to_sam_passwd(struct samu *to,
63                              struct samr_UserInfo25 *from);
64 void copy_id26_to_sam_passwd(struct samu *to,
65                              struct samr_UserInfo26 *from);
66
67 /* The following definitions come from rpc_server/srv_samr_chgpasswd.c  */
68
69 bool chgpasswd(const char *name, const char *rhost, const struct passwd *pass,
70                const char *oldpass, const char *newpass, bool as_root);
71 NTSTATUS pass_oem_change(char *user, const char *rhost,
72                          uchar password_encrypted_with_lm_hash[516],
73                          const uchar old_lm_hash_encrypted[16],
74                          uchar password_encrypted_with_nt_hash[516],
75                          const uchar old_nt_hash_encrypted[16],
76                          enum samPwdChangeReason *reject_reason);
77 NTSTATUS check_password_complexity(const char *username,
78                                    const char *password,
79                                    enum samPwdChangeReason *samr_reject_reason);