Copyright (C) Andrew Tridgell 1992-2000
Copyright (C) Luke Kenneth Casson Leighton 1996-2000
Copyright (C) Paul Ashton 1997-2000
- Copyright (C) Jean François Micouleau 1998-2001
+ Copyright (C) Jean François Micouleau 1998-2001
Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _RPC_SAMR_H /* _RPC_SAMR_H */
#define SAMR_QUERY_USERGROUPS 0x27
#define SAMR_QUERY_DISPINFO 0x28
-#define SAMR_UNKNOWN_29 0x29
+#define SAMR_GET_DISPENUM_INDEX 0x29
#define SAMR_UNKNOWN_2a 0x2a
#define SAMR_UNKNOWN_2b 0x2b
#define SAMR_GET_USRDOM_PWINFO 0x2c
#define SAMR_REMOVE_SID_FOREIGN_DOMAIN 0x2d
-#define SAMR_UNKNOWN_2E 0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */
+#define SAMR_QUERY_DOMAIN_INFO2 0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */
#define SAMR_UNKNOWN_2f 0x2f
#define SAMR_QUERY_DISPINFO3 0x30 /* Alias for SAMR_QUERY_DISPINFO
with info level 3 */
#define SAMR_CONNECT 0x39
#define SAMR_SET_USERINFO 0x3A
#define SAMR_CONNECT4 0x3E
+#define SAMR_CHGPASSWD_USER3 0x3F
#define SAMR_CONNECT5 0x40
typedef struct logon_hours_info
UNIHDR hdr_profile_path; /* profile path unicode string header */
UNIHDR hdr_acct_desc ; /* user description */
UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
- UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
+ UNIHDR hdr_comment;
UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
uint8 lm_pwd[16]; /* lm user passwords */
UNISTR2 uni_profile_path; /* profile path unicode string */
UNISTR2 uni_acct_desc ; /* user description unicode string */
UNISTR2 uni_workstations; /* login from workstations unicode string */
- UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
+ UNISTR2 uni_comment;
UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
LOGON_HRS logon_hrs;
typedef struct sam_user_info_24
{
uint8 pass[516];
- uint16 pw_len;
+ uint8 pw_len;
} SAM_USER_INFO_24;
/*
UNIHDR hdr_profile_path; /* profile path unicode string header */
UNIHDR hdr_acct_desc ; /* user description */
UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
- UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
+ UNIHDR hdr_comment;
UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
uint8 lm_pwd[16]; /* lm user passwords */
uint32 group_rid; /* Primary Group ID */
uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
+ uint32 fields_present;
- uint32 unknown_6[6];
+ uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
+ /* uint8 pad[2] */
+ uint32 ptr_logon_hrs; /* pointer to logon hours */
+
+ /* Was unknown_5. */
+ uint16 bad_password_count;
+ uint16 logon_count;
+
+ uint8 padding1[6];
+
+ uint8 passmustchange; /* 0x00 must change = 0x01 */
+
+ uint8 padding2;
uint8 pass[532];
UNISTR2 uni_profile_path; /* profile path unicode string */
UNISTR2 uni_acct_desc ; /* user description unicode string */
UNISTR2 uni_workstations; /* login from workstations unicode string */
- UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
+ UNISTR2 uni_comment;
UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
+ LOGON_HRS logon_hrs;
} SAM_USER_INFO_25;
+/* SAM_USER_INFO_26 */
+typedef struct sam_user_info_26
+{
+ uint8 pass[532];
+ uint8 pw_len;
+} SAM_USER_INFO_26;
+
/* SAM_USER_INFO_21 */
typedef struct sam_user_info_21
UNIHDR hdr_profile_path; /* profile path unicode string header */
UNIHDR hdr_acct_desc ; /* user description */
UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
- UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
+ UNIHDR hdr_comment;
UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
uint8 lm_pwd[16]; /* lm user passwords */
UNISTR2 uni_profile_path; /* profile path unicode string */
UNISTR2 uni_acct_desc ; /* user description unicode string */
UNISTR2 uni_workstations; /* login from workstations unicode string */
- UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
+ UNISTR2 uni_comment;
UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
LOGON_HRS logon_hrs;
} SAM_USER_INFO_16;
+
/* SAM_USER_INFO_7 */
typedef struct sam_user_info_7
{
} SAM_USER_INFO_7;
+/* SAM_USER_INFO_9 */
+typedef struct sam_user_info_9
+{
+ uint32 rid_group; /* Primary Group RID */
+} SAM_USER_INFO_9;
+
+
/* SAMR_Q_CLOSE_HND - probably a policy handle close */
typedef struct q_samr_close_hnd_info
{
/* SAMR_R_GET_USRDOM_PWINFO */
typedef struct r_samr_usrdom_pwinfo_info
{
- uint16 unknown_0; /* 0000 */
+ uint16 min_pwd_length;
uint16 unknown_1; /* 0x0016 or 0x0015 */
- uint32 unknown_2; /* 0x0000 0000 */
+ uint32 password_properties;
NTSTATUS status;
} SAMR_R_GET_USRDOM_PWINFO;
} SAMR_Q_QUERY_DOMAIN_INFO;
+typedef struct sam_unknown_info_1_inf
+{
+ uint16 min_length_password;
+ uint16 password_history;
+ uint32 password_properties;
+ NTTIME expire;
+ NTTIME min_passwordage;
+
+} SAM_UNK_INFO_1;
+
+typedef struct sam_unknown_info_2_inf
+{
+ NTTIME logout; /* whether users are forcibly disconnected when logon hours expire */
+ UNIHDR hdr_comment; /* comment according to samba4 idl */
+ UNIHDR hdr_domain; /* domain name unicode header */
+ UNIHDR hdr_server; /* server name unicode header */
+
+ /* put all the data in here, at the moment, including what the above
+ pointer is referring to
+ */
+
+ uint64 seq_num;
+
+ uint32 unknown_4; /* 0x0000 0001 */
+ uint32 server_role;
+ uint32 unknown_6; /* 0x0000 0001 */
+ uint32 num_domain_usrs; /* number of users in domain */
+ uint32 num_domain_grps; /* number of domain groups in domain */
+ uint32 num_local_grps; /* number of local groups in domain */
+
+ UNISTR2 uni_comment; /* comment unicode string */
+ UNISTR2 uni_domain; /* domain name unicode string */
+ UNISTR2 uni_server; /* server name unicode string */
+
+} SAM_UNK_INFO_2;
+
typedef struct sam_unknown_info_3_info
{
NTTIME logout;
/* 0x8000 0000 */ /* DON'T forcibly disconnect remote users from server when logon hours expire*/
-
/* 0x0000 0000 */ /* forcibly disconnect remote users from server when logon hours expire*/
} SAM_UNK_INFO_3;
-typedef struct sam_unknown_info_6_info
+typedef struct sam_unknown_info_4_inf
{
- uint32 unknown_0; /* 0x0000 0000 */
+ UNIHDR hdr_comment; /* comment according to samba4 idl */
+ UNISTR2 uni_comment; /* comment unicode string */
- uint32 ptr_0; /* pointer to unknown structure */
- uint8 padding[12]; /* 12 bytes zeros */
+} SAM_UNK_INFO_4;
+
+typedef struct sam_unknown_info_5_inf
+{
+ UNIHDR hdr_domain; /* domain name unicode header */
+ UNISTR2 uni_domain; /* domain name unicode string */
+
+} SAM_UNK_INFO_5;
+
+typedef struct sam_unknown_info_6_info
+{
+ UNIHDR hdr_server; /* server name unicode header */
+ UNISTR2 uni_server; /* server name unicode string */
} SAM_UNK_INFO_6;
typedef struct sam_unknown_info_8_info
{
- UINT64_S seq_num;
+ uint64 seq_num;
NTTIME domain_create_time;
} SAM_UNK_INFO_8;
+typedef struct sam_unknown_info_9_info
+{
+ uint32 unknown;
+
+} SAM_UNK_INFO_9;
+
typedef struct sam_unknown_info_12_inf
{
NTTIME duration;
} SAM_UNK_INFO_12;
-typedef struct sam_unknown_info_5_inf
+typedef struct sam_unknown_info_13_info
{
- UNIHDR hdr_server; /* server name unicode header */
- UNISTR2 uni_server; /* server name unicode string */
-
-} SAM_UNK_INFO_5;
-
-typedef struct sam_unknown_info_2_inf
-{
- NTTIME logout; /* whether users are forcibly disconnected when logon hours expire */
- UNIHDR hdr_comment; /* comment according to samba4 idl */
- UNIHDR hdr_domain; /* domain name unicode header */
- UNIHDR hdr_server; /* server name unicode header */
-
- /* put all the data in here, at the moment, including what the above
- pointer is referring to
- */
-
- UINT64_S seq_num;
-
- uint32 unknown_4; /* 0x0000 0001 */
- uint32 server_role;
- uint32 unknown_6; /* 0x0000 0001 */
- uint32 num_domain_usrs; /* number of users in domain */
- uint32 num_domain_grps; /* number of domain groups in domain */
- uint32 num_local_grps; /* number of local groups in domain */
-
- uint8 padding[12]; /* 12 bytes zeros */
-
- UNISTR2 uni_comment; /* comment unicode string */
- UNISTR2 uni_domain; /* domain name unicode string */
- UNISTR2 uni_server; /* server name unicode string */
-
-} SAM_UNK_INFO_2;
-
-typedef struct sam_unknown_info_1_inf
-{
- uint16 min_length_password;
- uint16 password_history;
- uint32 flag;
- NTTIME expire;
- NTTIME min_passwordage;
-
-} SAM_UNK_INFO_1;
+ uint64 seq_num;
+ NTTIME domain_create_time;
+ uint32 unknown1;
+ uint32 unknown2;
+} SAM_UNK_INFO_13;
typedef struct sam_unknown_ctr_info
{
SAM_UNK_INFO_1 inf1;
SAM_UNK_INFO_2 inf2;
SAM_UNK_INFO_3 inf3;
+ SAM_UNK_INFO_4 inf4;
SAM_UNK_INFO_5 inf5;
SAM_UNK_INFO_6 inf6;
SAM_UNK_INFO_7 inf7;
SAM_UNK_INFO_8 inf8;
+ SAM_UNK_INFO_9 inf9;
SAM_UNK_INFO_12 inf12;
+ SAM_UNK_INFO_13 inf13;
} info;
POLICY_HND pol; /* policy handle */
uint32 start_idx; /* number of values (0 indicates unlimited?) */
- uint16 acb_mask; /* 0x0000 indicates all */
- uint16 unknown_1; /* 0x0000 */
+ uint32 acb_mask; /* 0x0000 indicates all */
uint32 max_size; /* 0x0000 ffff */
uint32 user_idx;
uint32 rid_user;
- uint16 acb_info;
+ uint32 acb_info;
UNIHDR hdr_acct_name;
UNIHDR hdr_user_name;
uint32 user_idx;
uint32 rid_user;
- uint16 acb_info;
+ uint32 acb_info;
UNIHDR hdr_srv_name;
UNIHDR hdr_srv_desc;
} SAMR_R_QUERY_DISPINFO;
+/* SAMR_Q_GET_DISPENUM_INDEX */
+typedef struct q_samr_get_dispenum_index
+{
+ POLICY_HND domain_pol;
+ uint16 switch_level;
+ LSA_STRING name;
+
+} SAMR_Q_GET_DISPENUM_INDEX;
+
+/* SAMR_R_GET_DISPENUM_INDEX */
+typedef struct r_samr_get_dispenum_index
+{
+ uint32 idx;
+ NTSTATUS status;
+
+} SAMR_R_GET_DISPENUM_INDEX;
/* SAMR_Q_DELETE_DOM_GROUP - delete domain group */
typedef struct q_samr_delete_dom_group_info
{
UNIHDR hdr_acct_name;
- uint32 unknown_1; /* 0x0000 0003 - number of group members? */
+ uint32 group_attr; /* 0x0000 0003 - group attribute */
uint32 num_members; /* 0x0000 0001 - number of group members? */
UNIHDR hdr_acct_desc;
typedef struct samr_group_info3
{
- uint32 unknown_1; /* 0x0000 0003 - number of group members? */
+ uint32 group_attr; /* 0x0000 0003 - group attribute */
} GROUP_INFO3;
} GROUP_INFO4;
+typedef struct samr_group_info5
+{
+ UNIHDR hdr_acct_name;
+
+ uint32 group_attr; /* 0x0000 0003 - group attribute */
+ uint32 num_members; /* 0x0000 0001 - number of group members? */
+
+ UNIHDR hdr_acct_desc;
+
+ UNISTR2 uni_acct_name;
+ UNISTR2 uni_acct_desc;
+
+} GROUP_INFO5;
+
+
/* GROUP_INFO_CTR */
typedef struct group_info_ctr
{
GROUP_INFO2 info2;
GROUP_INFO3 info3;
GROUP_INFO4 info4;
-
+ GROUP_INFO5 info5;
} group;
} GROUP_INFO_CTR;
uint32 num_member;
} ALIAS_INFO1;
+typedef struct {
+ UNISTR4 name;
+} ALIAS_INFO2;
+
typedef struct {
UNISTR4 description;
} ALIAS_INFO3;
uint16 level;
union {
ALIAS_INFO1 info1;
+ ALIAS_INFO2 info2;
ALIAS_INFO3 info3;
} alias;
} ALIAS_INFO_CTR;
union
{
SAM_USER_INFO_7 *id7;
+ SAM_USER_INFO_9 *id9;
SAM_USER_INFO_16 *id16;
SAM_USER_INFO_17 *id17;
SAM_USER_INFO_18 *id18;
SAM_USER_INFO_23 *id23;
SAM_USER_INFO_24 *id24;
SAM_USER_INFO_25 *id25;
+ SAM_USER_INFO_26 *id26;
void* id; /* to make typecasting easy */
} info;
/* SAMR_Q_CONNECT_ANON - probably an open */
-typedef struct q_samr_connect_anon_info
-{
+typedef struct q_samr_connect_anon_info {
uint32 ptr; /* ptr? */
- uint16 unknown_0; /* 0x005c */
- uint16 unknown_1; /* 0x0001 */
+ uint16 unknown_0; /* Only pushed if ptr is non-zero. */
uint32 access_mask;
-
} SAMR_Q_CONNECT_ANON;
/* SAMR_R_CONNECT_ANON - probably an open */
} SAMR_Q_GET_DOM_PWINFO;
+#define DOMAIN_PASSWORD_COMPLEX 0x00000001
+#define DOMAIN_PASSWORD_NO_ANON_CHANGE 0x00000002
+#define DOMAIN_PASSWORD_NO_CLEAR_CHANGE 0x00000004
+#define DOMAIN_LOCKOUT_ADMINS 0x00000008
+#define DOMAIN_PASSWORD_STORE_CLEARTEXT 0x00000010
+#define DOMAIN_REFUSE_PASSWORD_CHANGE 0x00000020
+
/* SAMR_R_GET_DOM_PWINFO */
typedef struct r_samr_get_dom_pwinfo
{
- /*
- * See Samba4 IDL
- */
- uint16 unk_0;
- uint32 unk_1;
+ uint16 min_pwd_length;
+ uint32 password_properties;
NTSTATUS status;
} SAMR_R_GET_DOM_PWINFO;
} SAMR_R_CHGPASSWD_USER;
+/* SAMR_Q_CHGPASSWD3 */
+typedef struct q_samr_chgpasswd_user3
+{
+ uint32 ptr_0;
+
+ UNIHDR hdr_dest_host; /* server name unicode header */
+ UNISTR2 uni_dest_host; /* server name unicode string */
+
+ UNIHDR hdr_user_name; /* username unicode string header */
+ UNISTR2 uni_user_name; /* username unicode string */
+
+ SAMR_ENC_PASSWD nt_newpass;
+ SAMR_ENC_HASH nt_oldhash;
+
+ uint32 lm_change; /* 0x0000 0001 */
+
+ SAMR_ENC_PASSWD lm_newpass;
+ SAMR_ENC_HASH lm_oldhash;
+
+ SAMR_ENC_PASSWD password3;
+
+} SAMR_Q_CHGPASSWD_USER3;
+
+#define REJECT_REASON_OTHER 0x00000000
+#define REJECT_REASON_TOO_SHORT 0x00000001
+#define REJECT_REASON_IN_HISTORY 0x00000002
+#define REJECT_REASON_NOT_COMPLEX 0x00000005
+
+/* SAMR_CHANGE_REJECT */
+typedef struct samr_change_reject
+{
+ uint32 reject_reason;
+ uint32 unknown1;
+ uint32 unknown2;
+
+} SAMR_CHANGE_REJECT;
+
+/* SAMR_R_CHGPASSWD3 */
+typedef struct r_samr_chgpasswd_user3
+{
+ uint32 ptr_info;
+ uint32 ptr_reject;
+ SAM_UNK_INFO_1 *info;
+ SAMR_CHANGE_REJECT *reject;
+ NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
+
+} SAMR_R_CHGPASSWD_USER3;
+
+
/* SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN */
typedef struct q_samr_remove_sid_foreign_domain_info
} DOM_SID3;
-/* SAMR_Q_UNKNOWN_2E */
-typedef struct q_samr_unknown_2e_info
+/* SAMR_Q_QUERY_DOMAIN_INFO2 */
+typedef struct q_samr_query_domain_info2
{
POLICY_HND domain_pol; /* policy handle */
uint16 switch_value;
-} SAMR_Q_UNKNOWN_2E;
+} SAMR_Q_QUERY_DOMAIN_INFO2;
-/* SAMR_R_UNKNOWN_2E */
-typedef struct r_samr_unknown_2e_info
+/* SAMR_R_QUERY_DOMAIN_INFO2 */
+typedef struct r_samr_query_domain_info2
{
uint32 ptr_0;
uint16 switch_value;
SAM_UNK_CTR *ctr;
NTSTATUS status; /* return status */
-} SAMR_R_UNKNOWN_2E;
+} SAMR_R_QUERY_DOMAIN_INFO2;
/* SAMR_Q_SET_DOMAIN_INFO */
typedef struct q_samr_set_domain_info