* Copyright (C) Paul Ashton 1997-2000,
* Copyright (C) Elrond 2000,
* Copyright (C) Jeremy Allison 2001,
- * 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/>.
*/
#include "includes.h"
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_close_hnd(const char *desc, SAMR_Q_CLOSE_HND * q_u,
+bool samr_io_q_close_hnd(const char *desc, SAMR_Q_CLOSE_HND * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_close_hnd(const char *desc, SAMR_R_CLOSE_HND * r_u,
+bool samr_io_r_close_hnd(const char *desc, SAMR_R_CLOSE_HND * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
/*******************************************************************
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_lookup_domain(const char *desc, SAMR_Q_LOOKUP_DOMAIN * q_u,
+bool samr_io_q_lookup_domain(const char *desc, SAMR_Q_LOOKUP_DOMAIN * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_lookup_domain(const char *desc, SAMR_R_LOOKUP_DOMAIN * r_u,
+bool samr_io_r_lookup_domain(const char *desc, SAMR_R_LOOKUP_DOMAIN * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_remove_sid_foreign_domain(const char *desc, SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN * q_u,
+bool samr_io_q_remove_sid_foreign_domain(const char *desc, SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_remove_sid_foreign_domain(const char *desc, SAMR_R_REMOVE_SID_FOREIGN_DOMAIN * r_u,
+bool samr_io_r_remove_sid_foreign_domain(const char *desc, SAMR_R_REMOVE_SID_FOREIGN_DOMAIN * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_open_domain(const char *desc, SAMR_Q_OPEN_DOMAIN * q_u,
+bool samr_io_q_open_domain(const char *desc, SAMR_Q_OPEN_DOMAIN * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_open_domain(const char *desc, SAMR_R_OPEN_DOMAIN * r_u,
+bool samr_io_r_open_domain(const char *desc, SAMR_R_OPEN_DOMAIN * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_get_usrdom_pwinfo(const char *desc, SAMR_Q_GET_USRDOM_PWINFO * q_u,
+bool samr_io_q_get_usrdom_pwinfo(const char *desc, SAMR_Q_GET_USRDOM_PWINFO * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_get_usrdom_pwinfo(const char *desc, SAMR_R_GET_USRDOM_PWINFO * r_u,
+bool samr_io_r_get_usrdom_pwinfo(const char *desc, SAMR_R_GET_USRDOM_PWINFO * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_set_sec_obj(const char *desc, SAMR_Q_SET_SEC_OBJ * q_u,
+bool samr_io_q_set_sec_obj(const char *desc, SAMR_Q_SET_SEC_OBJ * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_query_sec_obj(const char *desc, SAMR_Q_QUERY_SEC_OBJ * q_u,
+bool samr_io_q_query_sec_obj(const char *desc, SAMR_Q_QUERY_SEC_OBJ * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_query_domain_info(const char *desc, SAMR_Q_QUERY_DOMAIN_INFO * q_u,
+bool samr_io_q_query_domain_info(const char *desc, SAMR_Q_QUERY_DOMAIN_INFO * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
u_1->password_properties = password_properties;
/* password never expire */
- u_1->expire.high = nt_expire.high;
- u_1->expire.low = nt_expire.low;
+ u_1->expire = nt_expire;
/* can change the password now */
- u_1->min_passwordage.high = nt_min_age.high;
- u_1->min_passwordage.low = nt_min_age.low;
+ u_1->min_passwordage = nt_min_age;
}
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_unk_info1(const char *desc, SAM_UNK_INFO_1 * u_1,
+static bool sam_io_unk_info1(const char *desc, SAM_UNK_INFO_1 * u_1,
prs_struct *ps, int depth)
{
if (u_1 == NULL)
const char *comment, const char *domain, const char *server,
uint32 seq_num, uint32 num_users, uint32 num_groups, uint32 num_alias, NTTIME nt_logout, uint32 server_role)
{
- u_2->logout.low = nt_logout.low;
- u_2->logout.high = nt_logout.high;
-
- u_2->seq_num.low = seq_num;
- u_2->seq_num.high = 0x00000000;
+ u_2->logout = nt_logout;
+ u_2->seq_num = seq_num;
+
u_2->unknown_4 = 0x00000001;
u_2->server_role = server_role;
u_2->unknown_6 = 0x00000001;
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_unk_info2(const char *desc, SAM_UNK_INFO_2 * u_2,
+static bool sam_io_unk_info2(const char *desc, SAM_UNK_INFO_2 * u_2,
prs_struct *ps, int depth)
{
if (u_2 == NULL)
void init_unk_info3(SAM_UNK_INFO_3 *u_3, NTTIME nt_logout)
{
- u_3->logout.low = nt_logout.low;
- u_3->logout.high = nt_logout.high;
+ u_3->logout = nt_logout;
}
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_unk_info3(const char *desc, SAM_UNK_INFO_3 * u_3,
+static bool sam_io_unk_info3(const char *desc, SAM_UNK_INFO_3 * u_3,
prs_struct *ps, int depth)
{
if (u_3 == NULL)
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_unk_info4(const char *desc, SAM_UNK_INFO_4 * u_4,
+static bool sam_io_unk_info4(const char *desc, SAM_UNK_INFO_4 * u_4,
prs_struct *ps, int depth)
{
if (u_4 == NULL)
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_unk_info5(const char *desc, SAM_UNK_INFO_5 * u_5,
+static bool sam_io_unk_info5(const char *desc, SAM_UNK_INFO_5 * u_5,
prs_struct *ps, int depth)
{
if (u_5 == NULL)
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_unk_info6(const char *desc, SAM_UNK_INFO_6 * u_6,
+static bool sam_io_unk_info6(const char *desc, SAM_UNK_INFO_6 * u_6,
prs_struct *ps, int depth)
{
if (u_6 == NULL)
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_unk_info7(const char *desc, SAM_UNK_INFO_7 * u_7,
+static bool sam_io_unk_info7(const char *desc, SAM_UNK_INFO_7 * u_7,
prs_struct *ps, int depth)
{
if (u_7 == NULL)
void init_unk_info8(SAM_UNK_INFO_8 * u_8, uint32 seq_num)
{
unix_to_nt_time(&u_8->domain_create_time, 0);
- u_8->seq_num.low = seq_num;
- u_8->seq_num.high = 0x0000;
+ u_8->seq_num = seq_num;
}
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_unk_info8(const char *desc, SAM_UNK_INFO_8 * u_8,
+static bool sam_io_unk_info8(const char *desc, SAM_UNK_INFO_8 * u_8,
prs_struct *ps, int depth)
{
if (u_8 == NULL)
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_unk_info9(const char *desc, SAM_UNK_INFO_9 * u_9,
+static bool sam_io_unk_info9(const char *desc, SAM_UNK_INFO_9 * u_9,
prs_struct *ps, int depth)
{
if (u_9 == NULL)
void init_unk_info12(SAM_UNK_INFO_12 * u_12, NTTIME nt_lock_duration, NTTIME nt_reset_time, uint16 lockout)
{
- u_12->duration.low = nt_lock_duration.low;
- u_12->duration.high = nt_lock_duration.high;
- u_12->reset_count.low = nt_reset_time.low;
- u_12->reset_count.high = nt_reset_time.high;
+ u_12->duration = nt_lock_duration;
+ u_12->reset_count = nt_reset_time;
u_12->bad_attempt_lockout = lockout;
}
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_unk_info12(const char *desc, SAM_UNK_INFO_12 * u_12,
+static bool sam_io_unk_info12(const char *desc, SAM_UNK_INFO_12 * u_12,
prs_struct *ps, int depth)
{
if (u_12 == NULL)
void init_unk_info13(SAM_UNK_INFO_13 * u_13, uint32 seq_num)
{
unix_to_nt_time(&u_13->domain_create_time, 0);
- u_13->seq_num.low = seq_num;
- u_13->seq_num.high = 0x0000;
+ u_13->seq_num = seq_num;
u_13->unknown1 = 0;
u_13->unknown2 = 0;
}
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_unk_info13(const char *desc, SAM_UNK_INFO_13 * u_13,
+static bool sam_io_unk_info13(const char *desc, SAM_UNK_INFO_13 * u_13,
prs_struct *ps, int depth)
{
if (u_13 == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_query_domain_info(const char *desc, SAMR_R_QUERY_DOMAIN_INFO * r_u,
+bool samr_io_r_query_domain_info(const char *desc, SAMR_R_QUERY_DOMAIN_INFO * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a SAMR_R_SET_SEC_OBJ structure.
********************************************************************/
-BOOL samr_io_r_set_sec_obj(const char *desc, SAMR_R_SET_SEC_OBJ * r_u,
+bool samr_io_r_set_sec_obj(const char *desc, SAMR_R_SET_SEC_OBJ * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a SAMR_R_QUERY_SEC_OBJ structure.
********************************************************************/
-BOOL samr_io_r_query_sec_obj(const char *desc, SAMR_R_QUERY_SEC_OBJ * r_u,
+bool samr_io_r_query_sec_obj(const char *desc, SAMR_R_QUERY_SEC_OBJ * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a SAM_STR1 structure.
********************************************************************/
-static BOOL sam_io_sam_str1(const char *desc, SAM_STR1 * sam, uint32 acct_buf,
+static bool sam_io_sam_str1(const char *desc, SAM_STR1 * sam, uint32 acct_buf,
uint32 name_buf, uint32 desc_buf,
prs_struct *ps, int depth)
{
reads or writes a SAM_ENTRY1 structure.
********************************************************************/
-static BOOL sam_io_sam_entry1(const char *desc, SAM_ENTRY1 * sam,
+static bool sam_io_sam_entry1(const char *desc, SAM_ENTRY1 * sam,
prs_struct *ps, int depth)
{
if (sam == NULL)
reads or writes a SAM_STR2 structure.
********************************************************************/
-static BOOL sam_io_sam_str2(const char *desc, SAM_STR2 * sam, uint32 acct_buf,
+static bool sam_io_sam_str2(const char *desc, SAM_STR2 * sam, uint32 acct_buf,
uint32 desc_buf, prs_struct *ps, int depth)
{
if (sam == NULL)
reads or writes a SAM_ENTRY2 structure.
********************************************************************/
-static BOOL sam_io_sam_entry2(const char *desc, SAM_ENTRY2 * sam,
+static bool sam_io_sam_entry2(const char *desc, SAM_ENTRY2 * sam,
prs_struct *ps, int depth)
{
if (sam == NULL)
reads or writes a SAM_STR3 structure.
********************************************************************/
-static BOOL sam_io_sam_str3(const char *desc, SAM_STR3 * sam, uint32 acct_buf,
+static bool sam_io_sam_str3(const char *desc, SAM_STR3 * sam, uint32 acct_buf,
uint32 desc_buf, prs_struct *ps, int depth)
{
if (sam == NULL)
reads or writes a SAM_ENTRY3 structure.
********************************************************************/
-static BOOL sam_io_sam_entry3(const char *desc, SAM_ENTRY3 * sam,
+static bool sam_io_sam_entry3(const char *desc, SAM_ENTRY3 * sam,
prs_struct *ps, int depth)
{
if (sam == NULL)
reads or writes a SAM_ENTRY4 structure.
********************************************************************/
-static BOOL sam_io_sam_entry4(const char *desc, SAM_ENTRY4 * sam,
+static bool sam_io_sam_entry4(const char *desc, SAM_ENTRY4 * sam,
prs_struct *ps, int depth)
{
if (sam == NULL)
reads or writes a SAM_ENTRY5 structure.
********************************************************************/
-static BOOL sam_io_sam_entry5(const char *desc, SAM_ENTRY5 * sam,
+static bool sam_io_sam_entry5(const char *desc, SAM_ENTRY5 * sam,
prs_struct *ps, int depth)
{
if (sam == NULL)
reads or writes a SAM_ENTRY structure.
********************************************************************/
-static BOOL sam_io_sam_entry(const char *desc, SAM_ENTRY * sam,
+static bool sam_io_sam_entry(const char *desc, SAM_ENTRY * sam,
prs_struct *ps, int depth)
{
if (sam == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_enum_dom_users(const char *desc, SAMR_Q_ENUM_DOM_USERS * q_e,
+bool samr_io_q_enum_dom_users(const char *desc, SAMR_Q_ENUM_DOM_USERS * q_e,
prs_struct *ps, int depth)
{
if (q_e == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_enum_dom_users(const char *desc, SAMR_R_ENUM_DOM_USERS * r_u,
+bool samr_io_r_enum_dom_users(const char *desc, SAMR_R_ENUM_DOM_USERS * r_u,
prs_struct *ps, int depth)
{
uint32 i;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_query_dispinfo(const char *desc, SAMR_Q_QUERY_DISPINFO * q_e,
+bool samr_io_q_query_dispinfo(const char *desc, SAMR_Q_QUERY_DISPINFO * q_e,
prs_struct *ps, int depth)
{
if (q_e == NULL)
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_sam_dispinfo_1(const char *desc, SAM_DISPINFO_1 * sam,
+static bool sam_io_sam_dispinfo_1(const char *desc, SAM_DISPINFO_1 * sam,
uint32 num_entries,
prs_struct *ps, int depth)
{
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_sam_dispinfo_2(const char *desc, SAM_DISPINFO_2 * sam,
+static bool sam_io_sam_dispinfo_2(const char *desc, SAM_DISPINFO_2 * sam,
uint32 num_entries,
prs_struct *ps, int depth)
{
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_sam_dispinfo_3(const char *desc, SAM_DISPINFO_3 * sam,
+static bool sam_io_sam_dispinfo_3(const char *desc, SAM_DISPINFO_3 * sam,
uint32 num_entries,
prs_struct *ps, int depth)
{
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_sam_dispinfo_4(const char *desc, SAM_DISPINFO_4 * sam,
+static bool sam_io_sam_dispinfo_4(const char *desc, SAM_DISPINFO_4 * sam,
uint32 num_entries,
prs_struct *ps, int depth)
{
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_sam_dispinfo_5(const char *desc, SAM_DISPINFO_5 * sam,
+static bool sam_io_sam_dispinfo_5(const char *desc, SAM_DISPINFO_5 * sam,
uint32 num_entries,
prs_struct *ps, int depth)
{
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_query_dispinfo(const char *desc, SAMR_R_QUERY_DISPINFO * r_u,
+bool samr_io_r_query_dispinfo(const char *desc, SAMR_R_QUERY_DISPINFO * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_open_group(const char *desc, SAMR_Q_OPEN_GROUP * q_u,
+bool samr_io_q_open_group(const char *desc, SAMR_Q_OPEN_GROUP * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_open_group(const char *desc, SAMR_R_OPEN_GROUP * r_u,
+bool samr_io_r_open_group(const char *desc, SAMR_R_OPEN_GROUP * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_group_info1(const char *desc, GROUP_INFO1 * gr1,
+bool samr_io_group_info1(const char *desc, GROUP_INFO1 * gr1,
prs_struct *ps, int depth)
{
uint16 dummy = 1;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_group_info2(const char *desc, GROUP_INFO2 *gr2, prs_struct *ps, int depth)
+bool samr_io_group_info2(const char *desc, GROUP_INFO2 *gr2, prs_struct *ps, int depth)
{
if (gr2 == NULL)
return False;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_group_info3(const char *desc, GROUP_INFO3 *gr3, prs_struct *ps, int depth)
+bool samr_io_group_info3(const char *desc, GROUP_INFO3 *gr3, prs_struct *ps, int depth)
{
if (gr3 == NULL)
return False;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_group_info4(const char *desc, GROUP_INFO4 * gr4,
+bool samr_io_group_info4(const char *desc, GROUP_INFO4 * gr4,
prs_struct *ps, int depth)
{
if (gr4 == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_group_info5(const char *desc, GROUP_INFO5 * gr5,
+bool samr_io_group_info5(const char *desc, GROUP_INFO5 * gr5,
prs_struct *ps, int depth)
{
uint16 dummy = 1;
reads or writes a structure.
********************************************************************/
-static BOOL samr_group_info_ctr(const char *desc, GROUP_INFO_CTR **ctr,
+static bool samr_group_info_ctr(const char *desc, GROUP_INFO_CTR **ctr,
prs_struct *ps, int depth)
{
if (UNMARSHALLING(ps))
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_create_dom_group(const char *desc, SAMR_Q_CREATE_DOM_GROUP * q_e,
+bool samr_io_q_create_dom_group(const char *desc, SAMR_Q_CREATE_DOM_GROUP * q_e,
prs_struct *ps, int depth)
{
if (q_e == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_create_dom_group(const char *desc, SAMR_R_CREATE_DOM_GROUP * r_u,
+bool samr_io_r_create_dom_group(const char *desc, SAMR_R_CREATE_DOM_GROUP * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_delete_dom_group(const char *desc, SAMR_Q_DELETE_DOM_GROUP * q_u,
+bool samr_io_q_delete_dom_group(const char *desc, SAMR_Q_DELETE_DOM_GROUP * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_delete_dom_group(const char *desc, SAMR_R_DELETE_DOM_GROUP * r_u,
+bool samr_io_r_delete_dom_group(const char *desc, SAMR_R_DELETE_DOM_GROUP * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_del_groupmem(const char *desc, SAMR_Q_DEL_GROUPMEM * q_e,
+bool samr_io_q_del_groupmem(const char *desc, SAMR_Q_DEL_GROUPMEM * q_e,
prs_struct *ps, int depth)
{
if (q_e == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_del_groupmem(const char *desc, SAMR_R_DEL_GROUPMEM * r_u,
+bool samr_io_r_del_groupmem(const char *desc, SAMR_R_DEL_GROUPMEM * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_add_groupmem(const char *desc, SAMR_Q_ADD_GROUPMEM * q_e,
+bool samr_io_q_add_groupmem(const char *desc, SAMR_Q_ADD_GROUPMEM * q_e,
prs_struct *ps, int depth)
{
if (q_e == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_add_groupmem(const char *desc, SAMR_R_ADD_GROUPMEM * r_u,
+bool samr_io_r_add_groupmem(const char *desc, SAMR_R_ADD_GROUPMEM * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_set_groupinfo(const char *desc, SAMR_Q_SET_GROUPINFO * q_e,
+bool samr_io_q_set_groupinfo(const char *desc, SAMR_Q_SET_GROUPINFO * q_e,
prs_struct *ps, int depth)
{
if (q_e == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_set_groupinfo(const char *desc, SAMR_R_SET_GROUPINFO * r_u,
+bool samr_io_r_set_groupinfo(const char *desc, SAMR_R_SET_GROUPINFO * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_query_groupinfo(const char *desc, SAMR_Q_QUERY_GROUPINFO * q_e,
+bool samr_io_q_query_groupinfo(const char *desc, SAMR_Q_QUERY_GROUPINFO * q_e,
prs_struct *ps, int depth)
{
if (q_e == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_query_groupinfo(const char *desc, SAMR_R_QUERY_GROUPINFO * r_u,
+bool samr_io_r_query_groupinfo(const char *desc, SAMR_R_QUERY_GROUPINFO * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_query_groupmem(const char *desc, SAMR_Q_QUERY_GROUPMEM * q_u,
+bool samr_io_q_query_groupmem(const char *desc, SAMR_Q_QUERY_GROUPMEM * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_query_groupmem(const char *desc, SAMR_R_QUERY_GROUPMEM * r_u,
+bool samr_io_r_query_groupmem(const char *desc, SAMR_R_QUERY_GROUPMEM * r_u,
prs_struct *ps, int depth)
{
uint32 i;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_query_usergroups(const char *desc, SAMR_Q_QUERY_USERGROUPS * q_u,
+bool samr_io_q_query_usergroups(const char *desc, SAMR_Q_QUERY_USERGROUPS * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_gids(const char *desc, uint32 *num_gids, DOM_GID ** gid,
+bool samr_io_gids(const char *desc, uint32 *num_gids, DOM_GID ** gid,
prs_struct *ps, int depth)
{
uint32 i;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_query_usergroups(const char *desc, SAMR_R_QUERY_USERGROUPS * r_u,
+bool samr_io_r_query_usergroups(const char *desc, SAMR_R_QUERY_USERGROUPS * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_enum_domains(const char *desc, SAMR_Q_ENUM_DOMAINS * q_e,
+bool samr_io_q_enum_domains(const char *desc, SAMR_Q_ENUM_DOMAINS * q_e,
prs_struct *ps, int depth)
{
if (q_e == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_enum_domains(const char *desc, SAMR_R_ENUM_DOMAINS * r_u,
+bool samr_io_r_enum_domains(const char *desc, SAMR_R_ENUM_DOMAINS * r_u,
prs_struct *ps, int depth)
{
uint32 i;
if(!prs_uint32("num_entries3", ps, depth, &r_u->num_entries3))
return False;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && r_u->num_entries2) {
r_u->sam = PRS_ALLOC_MEM(ps,SAM_ENTRY,r_u->num_entries2);
r_u->uni_dom_name = PRS_ALLOC_MEM(ps,UNISTR2,r_u->num_entries2);
}
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_enum_dom_groups(const char *desc, SAMR_Q_ENUM_DOM_GROUPS * q_e,
+bool samr_io_q_enum_dom_groups(const char *desc, SAMR_Q_ENUM_DOM_GROUPS * q_e,
prs_struct *ps, int depth)
{
if (q_e == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_enum_dom_groups(const char *desc, SAMR_R_ENUM_DOM_GROUPS * r_u,
+bool samr_io_r_enum_dom_groups(const char *desc, SAMR_R_ENUM_DOM_GROUPS * r_u,
prs_struct *ps, int depth)
{
uint32 i;
if(!prs_uint32("num_entries3", ps, depth, &r_u->num_entries3))
return False;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && r_u->num_entries2) {
r_u->sam = PRS_ALLOC_MEM(ps,SAM_ENTRY,r_u->num_entries2);
r_u->uni_grp_name = PRS_ALLOC_MEM(ps,UNISTR2,r_u->num_entries2);
}
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_enum_dom_aliases(const char *desc, SAMR_Q_ENUM_DOM_ALIASES * q_e,
+bool samr_io_q_enum_dom_aliases(const char *desc, SAMR_Q_ENUM_DOM_ALIASES * q_e,
prs_struct *ps, int depth)
{
if (q_e == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_enum_dom_aliases(const char *desc, SAMR_R_ENUM_DOM_ALIASES * r_u,
+bool samr_io_r_enum_dom_aliases(const char *desc, SAMR_R_ENUM_DOM_ALIASES * r_u,
prs_struct *ps, int depth)
{
uint32 i;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_alias_info1(const char *desc, ALIAS_INFO1 * al1,
+bool samr_io_alias_info1(const char *desc, ALIAS_INFO1 * al1,
prs_struct *ps, int depth)
{
if (al1 == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_alias_info3(const char *desc, ALIAS_INFO3 *al3,
+bool samr_io_alias_info3(const char *desc, ALIAS_INFO3 *al3,
prs_struct *ps, int depth)
{
if (al3 == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_alias_info2(const char *desc, ALIAS_INFO2 *al2,
+bool samr_io_alias_info2(const char *desc, ALIAS_INFO2 *al2,
prs_struct *ps, int depth)
{
if (al2 == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_alias_info_ctr(const char *desc, prs_struct *ps, int depth, ALIAS_INFO_CTR * ctr)
+bool samr_alias_info_ctr(const char *desc, prs_struct *ps, int depth, ALIAS_INFO_CTR * ctr)
{
if ( !ctr )
return False;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_query_aliasinfo(const char *desc, SAMR_Q_QUERY_ALIASINFO *in,
+bool samr_io_q_query_aliasinfo(const char *desc, SAMR_Q_QUERY_ALIASINFO *in,
prs_struct *ps, int depth)
{
if ( !in )
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_query_aliasinfo(const char *desc, SAMR_R_QUERY_ALIASINFO *out,
+bool samr_io_r_query_aliasinfo(const char *desc, SAMR_R_QUERY_ALIASINFO *out,
prs_struct *ps, int depth)
{
if ( !out )
if(!prs_align(ps))
return False;
- if ( !prs_pointer("alias", ps, depth, (void**)&out->ctr, sizeof(ALIAS_INFO_CTR), (PRS_POINTER_CAST)samr_alias_info_ctr))
+ if ( !prs_pointer("alias", ps, depth, (void*)&out->ctr, sizeof(ALIAS_INFO_CTR), (PRS_POINTER_CAST)samr_alias_info_ctr))
return False;
if(!prs_align(ps))
return False;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_set_aliasinfo(const char *desc, SAMR_Q_SET_ALIASINFO * q_u,
+bool samr_io_q_set_aliasinfo(const char *desc, SAMR_Q_SET_ALIASINFO * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_set_aliasinfo(const char *desc, SAMR_R_SET_ALIASINFO * r_u,
+bool samr_io_r_set_aliasinfo(const char *desc, SAMR_R_SET_ALIASINFO * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a SAMR_Q_QUERY_USERALIASES structure.
********************************************************************/
-BOOL samr_io_q_query_useraliases(const char *desc, SAMR_Q_QUERY_USERALIASES * q_u,
+bool samr_io_q_query_useraliases(const char *desc, SAMR_Q_QUERY_USERALIASES * q_u,
prs_struct *ps, int depth)
{
fstring tmp;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_rids(const char *desc, uint32 *num_rids, uint32 **rid,
+bool samr_io_rids(const char *desc, uint32 *num_rids, uint32 **rid,
prs_struct *ps, int depth)
{
fstring tmp;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_query_useraliases(const char *desc, SAMR_R_QUERY_USERALIASES * r_u,
+bool samr_io_r_query_useraliases(const char *desc, SAMR_R_QUERY_USERALIASES * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_open_alias(const char *desc, SAMR_Q_OPEN_ALIAS * q_u,
+bool samr_io_q_open_alias(const char *desc, SAMR_Q_OPEN_ALIAS * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_open_alias(const char *desc, SAMR_R_OPEN_ALIAS * r_u,
+bool samr_io_r_open_alias(const char *desc, SAMR_R_OPEN_ALIAS * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
q_u->flags = flags;
q_u->ptr = 0;
q_u->num_rids2 = num_rids;
- q_u->rid = TALLOC_ZERO_ARRAY(ctx, uint32, num_rids );
+ if (num_rids) {
+ q_u->rid = TALLOC_ZERO_ARRAY(ctx, uint32, num_rids );
+ } else {
+ q_u->rid = NULL;
+ }
if (q_u->rid == NULL) {
q_u->num_rids1 = 0;
q_u->num_rids2 = 0;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_lookup_rids(const char *desc, SAMR_Q_LOOKUP_RIDS * q_u,
+bool samr_io_q_lookup_rids(const char *desc, SAMR_Q_LOOKUP_RIDS * q_u,
prs_struct *ps, int depth)
{
uint32 i;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_lookup_rids(const char *desc, SAMR_R_LOOKUP_RIDS * r_u,
+bool samr_io_r_lookup_rids(const char *desc, SAMR_R_LOOKUP_RIDS * r_u,
prs_struct *ps, int depth)
{
uint32 i;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_delete_alias(const char *desc, SAMR_Q_DELETE_DOM_ALIAS * q_u,
+bool samr_io_q_delete_alias(const char *desc, SAMR_Q_DELETE_DOM_ALIAS * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_delete_alias(const char *desc, SAMR_R_DELETE_DOM_ALIAS * r_u,
+bool samr_io_r_delete_alias(const char *desc, SAMR_R_DELETE_DOM_ALIAS * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_create_dom_alias(const char *desc, SAMR_Q_CREATE_DOM_ALIAS * q_u,
+bool samr_io_q_create_dom_alias(const char *desc, SAMR_Q_CREATE_DOM_ALIAS * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_create_dom_alias(const char *desc, SAMR_R_CREATE_DOM_ALIAS * r_u,
+bool samr_io_r_create_dom_alias(const char *desc, SAMR_R_CREATE_DOM_ALIAS * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_add_aliasmem(const char *desc, SAMR_Q_ADD_ALIASMEM * q_u,
+bool samr_io_q_add_aliasmem(const char *desc, SAMR_Q_ADD_ALIASMEM * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_add_aliasmem(const char *desc, SAMR_R_ADD_ALIASMEM * r_u,
+bool samr_io_r_add_aliasmem(const char *desc, SAMR_R_ADD_ALIASMEM * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_del_aliasmem(const char *desc, SAMR_Q_DEL_ALIASMEM * q_u,
+bool samr_io_q_del_aliasmem(const char *desc, SAMR_Q_DEL_ALIASMEM * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_del_aliasmem(const char *desc, SAMR_R_DEL_ALIASMEM * r_u,
+bool samr_io_r_del_aliasmem(const char *desc, SAMR_R_DEL_ALIASMEM * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_delete_dom_alias(const char *desc, SAMR_Q_DELETE_DOM_ALIAS * q_u,
+bool samr_io_q_delete_dom_alias(const char *desc, SAMR_Q_DELETE_DOM_ALIAS * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_delete_dom_alias(const char *desc, SAMR_R_DELETE_DOM_ALIAS * r_u,
+bool samr_io_r_delete_dom_alias(const char *desc, SAMR_R_DELETE_DOM_ALIAS * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_query_aliasmem(const char *desc, SAMR_Q_QUERY_ALIASMEM * q_u,
+bool samr_io_q_query_aliasmem(const char *desc, SAMR_Q_QUERY_ALIASMEM * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_query_aliasmem(const char *desc, SAMR_R_QUERY_ALIASMEM * r_u,
+bool samr_io_r_query_aliasmem(const char *desc, SAMR_R_QUERY_ALIASMEM * r_u,
prs_struct *ps, int depth)
{
uint32 i;
if(!prs_uint32("num_sids1", ps, depth, &r_u->num_sids1))
return False;
- ptr_sid = TALLOC_ARRAY(ps->mem_ctx, uint32, r_u->num_sids1);
- if (!ptr_sid) {
- return False;
+ /* We must always use talloc here even when marshalling. */
+ if (r_u->num_sids1) {
+ ptr_sid = TALLOC_ARRAY(ps->mem_ctx, uint32, r_u->num_sids1);
+ if (!ptr_sid) {
+ return False;
+ }
+ } else {
+ ptr_sid = NULL;
}
for (i = 0; i < r_u->num_sids1; i++) {
}
if (UNMARSHALLING(ps)) {
- r_u->sid = TALLOC_ARRAY(ps->mem_ctx, DOM_SID2, r_u->num_sids1);
+ if (r_u->num_sids1) {
+ r_u->sid = TALLOC_ARRAY(ps->mem_ctx, DOM_SID2, r_u->num_sids1);
+ if (!r_u->sid) {
+ return False;
+ }
+ } else {
+ r_u->sid = NULL;
+ }
}
for (i = 0; i < r_u->num_sids1; i++) {
q_u->ptr = 0;
q_u->num_names2 = num_names;
- if (!(q_u->hdr_name = TALLOC_ZERO_ARRAY(ctx, UNIHDR, num_names)))
- return NT_STATUS_NO_MEMORY;
+ if (num_names) {
+ if (!(q_u->hdr_name = TALLOC_ZERO_ARRAY(ctx, UNIHDR, num_names)))
+ return NT_STATUS_NO_MEMORY;
- if (!(q_u->uni_name = TALLOC_ZERO_ARRAY(ctx, UNISTR2, num_names)))
- return NT_STATUS_NO_MEMORY;
+ if (!(q_u->uni_name = TALLOC_ZERO_ARRAY(ctx, UNISTR2, num_names)))
+ return NT_STATUS_NO_MEMORY;
+ } else {
+ q_u->hdr_name = NULL;
+ q_u->uni_name = NULL;
+ }
for (i = 0; i < num_names; i++) {
init_unistr2(&q_u->uni_name[i], name[i], UNI_FLAGS_NONE); /* unicode string for machine account */
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_lookup_names(const char *desc, SAMR_Q_LOOKUP_NAMES * q_u,
+bool samr_io_q_lookup_names(const char *desc, SAMR_Q_LOOKUP_NAMES * q_u,
prs_struct *ps, int depth)
{
uint32 i;
NTSTATUS init_samr_r_lookup_names(TALLOC_CTX *ctx, SAMR_R_LOOKUP_NAMES * r_u,
uint32 num_rids,
- uint32 *rid, uint32 *type,
+ uint32 *rid, enum lsa_SidType *type,
NTSTATUS status)
{
DEBUG(5, ("init_samr_r_lookup_names\n"));
if (!(r_u->types = TALLOC_ZERO_ARRAY(ctx, uint32, num_rids)))
return NT_STATUS_NO_MEMORY;
- if (!r_u->rids || !r_u->types)
- goto empty;
-
for (i = 0; i < num_rids; i++) {
r_u->rids[i] = rid[i];
r_u->types[i] = type[i];
}
} else {
- empty:
r_u->num_types1 = 0;
r_u->ptr_types = 0;
r_u->num_types2 = 0;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_lookup_names(const char *desc, SAMR_R_LOOKUP_NAMES * r_u,
+bool samr_io_r_lookup_names(const char *desc, SAMR_R_LOOKUP_NAMES * r_u,
prs_struct *ps, int depth)
{
uint32 i;
return False;
}
- if (UNMARSHALLING(ps))
+ if (UNMARSHALLING(ps) && r_u->num_rids2) {
r_u->rids = PRS_ALLOC_MEM(ps, uint32, r_u->num_rids2);
- if (!r_u->rids) {
- DEBUG(0, ("NULL rids in samr_io_r_lookup_names\n"));
- return False;
+ if (!r_u->rids) {
+ DEBUG(0, ("NULL rids in samr_io_r_lookup_names\n"));
+ return False;
+ }
}
for (i = 0; i < r_u->num_rids2; i++) {
return False;
}
- if (UNMARSHALLING(ps))
+ if (UNMARSHALLING(ps) && r_u->num_types2) {
r_u->types = PRS_ALLOC_MEM(ps, uint32, r_u->num_types2);
- if (!r_u->types) {
- DEBUG(0, ("NULL types in samr_io_r_lookup_names\n"));
- return False;
+ if (!r_u->types) {
+ DEBUG(0, ("NULL types in samr_io_r_lookup_names\n"));
+ return False;
+ }
}
for (i = 0; i < r_u->num_types2; i++) {
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_delete_dom_user(const char *desc, SAMR_Q_DELETE_DOM_USER * q_u,
+bool samr_io_q_delete_dom_user(const char *desc, SAMR_Q_DELETE_DOM_USER * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_delete_dom_user(const char *desc, SAMR_R_DELETE_DOM_USER * r_u,
+bool samr_io_r_delete_dom_user(const char *desc, SAMR_R_DELETE_DOM_USER * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_open_user(const char *desc, SAMR_Q_OPEN_USER * q_u,
+bool samr_io_q_open_user(const char *desc, SAMR_Q_OPEN_USER * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_open_user(const char *desc, SAMR_R_OPEN_USER * r_u,
+bool samr_io_r_open_user(const char *desc, SAMR_R_OPEN_USER * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_create_user(const char *desc, SAMR_Q_CREATE_USER * q_u,
+bool samr_io_q_create_user(const char *desc, SAMR_Q_CREATE_USER * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_create_user(const char *desc, SAMR_R_CREATE_USER * r_u,
+bool samr_io_r_create_user(const char *desc, SAMR_R_CREATE_USER * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_query_userinfo(const char *desc, SAMR_Q_QUERY_USERINFO * q_u,
+bool samr_io_q_query_userinfo(const char *desc, SAMR_Q_QUERY_USERINFO * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a LOGON_HRS structure.
********************************************************************/
-static BOOL sam_io_logon_hrs(const char *desc, LOGON_HRS * hrs,
+static bool sam_io_logon_hrs(const char *desc, LOGON_HRS * hrs,
prs_struct *ps, int depth)
{
if (hrs == NULL)
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_user_info18(const char *desc, SAM_USER_INFO_18 * u,
+static bool sam_io_user_info18(const char *desc, SAM_USER_INFO_18 * u,
prs_struct *ps, int depth)
{
if (u == NULL)
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_user_info7(const char *desc, SAM_USER_INFO_7 * usr,
+static bool sam_io_user_info7(const char *desc, SAM_USER_INFO_7 * usr,
prs_struct *ps, int depth)
{
if (usr == NULL)
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_user_info9(const char *desc, SAM_USER_INFO_9 * usr,
+static bool sam_io_user_info9(const char *desc, SAM_USER_INFO_9 * usr,
prs_struct *ps, int depth)
{
if (usr == NULL)
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_user_info16(const char *desc, SAM_USER_INFO_16 * usr,
+static bool sam_io_user_info16(const char *desc, SAM_USER_INFO_16 * usr,
prs_struct *ps, int depth)
{
if (usr == NULL)
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_user_info17(const char *desc, SAM_USER_INFO_17 * usr,
+static bool sam_io_user_info17(const char *desc, SAM_USER_INFO_17 * usr,
prs_struct *ps, int depth)
{
if (usr == NULL)
init_sam_user_infoa
*************************************************************************/
-void init_sam_user_info24(SAM_USER_INFO_24 * usr, char newpass[516], uint16 pw_len)
+void init_sam_user_info24(SAM_USER_INFO_24 * usr, char newpass[516],
+ uint8 pw_len)
{
DEBUG(10, ("init_sam_user_info24:\n"));
memcpy(usr->pass, newpass, sizeof(usr->pass));
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_user_info24(const char *desc, SAM_USER_INFO_24 * usr,
+static bool sam_io_user_info24(const char *desc, SAM_USER_INFO_24 * usr,
prs_struct *ps, int depth)
{
if (usr == NULL)
return False;
if (MARSHALLING(ps) && (usr->pw_len != 0)) {
- if (!prs_uint16("pw_len", ps, depth, &usr->pw_len))
+ if (!prs_uint8("pw_len", ps, depth, &usr->pw_len))
return False;
} else if (UNMARSHALLING(ps)) {
- if (!prs_uint16("pw_len", ps, depth, &usr->pw_len))
+ if (!prs_uint8("pw_len", ps, depth, &usr->pw_len))
return False;
}
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_user_info26(const char *desc, SAM_USER_INFO_26 * usr,
+static bool sam_io_user_info26(const char *desc, SAM_USER_INFO_26 * usr,
prs_struct *ps, int depth)
{
if (usr == NULL)
copy_unistr2(&usr->uni_workstations, wkstas);
init_uni_hdr(&usr->hdr_workstations, &usr->uni_workstations);
- copy_unistr2(&usr->uni_unknown_str, unk_str);
- init_uni_hdr(&usr->hdr_unknown_str, &usr->uni_unknown_str);
+ copy_unistr2(&usr->uni_comment, unk_str);
+ init_uni_hdr(&usr->hdr_comment, &usr->uni_comment);
copy_unistr2(&usr->uni_munged_dial, mung_dial);
init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial);
init_unistr2(&usr->uni_workstations, wkstas, UNI_FLAGS_NONE);
init_uni_hdr(&usr->hdr_workstations, &usr->uni_workstations);
- init_unistr2(&usr->uni_unknown_str, unk_str, UNI_FLAGS_NONE);
- init_uni_hdr(&usr->hdr_unknown_str, &usr->uni_unknown_str);
+ init_unistr2(&usr->uni_comment, unk_str, UNI_FLAGS_NONE);
+ init_uni_hdr(&usr->hdr_comment, &usr->uni_comment);
init_unistr2_from_datablob(&usr->uni_munged_dial, &blob);
init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial);
}
}
+
+/*************************************************************************
+ init_samr_user_info25P
+ fields_present = ACCT_NT_PWD_SET | ACCT_LM_PWD_SET | ACCT_FLAGS
+*************************************************************************/
+
+void init_sam_user_info25P(SAM_USER_INFO_25 * usr,
+ uint32 fields_present, uint32 acb_info,
+ char newpass[532])
+{
+ usr->fields_present = fields_present;
+ ZERO_STRUCT(usr->padding1);
+ ZERO_STRUCT(usr->padding2);
+
+ usr->acb_info = acb_info;
+ memcpy(usr->pass, newpass, sizeof(usr->pass));
+}
+
+
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_user_info23(const char *desc, SAM_USER_INFO_23 * usr,
+static bool sam_io_user_info23(const char *desc, SAM_USER_INFO_23 * usr,
prs_struct *ps, int depth)
{
if (usr == NULL)
return False;
if(!smb_io_unihdr("hdr_workstations", &usr->hdr_workstations, ps, depth)) /* wkstas user can log on from */
return False;
- if(!smb_io_unihdr("hdr_unknown_str ", &usr->hdr_unknown_str, ps, depth)) /* unknown string */
+ if(!smb_io_unihdr("hdr_comment ", &usr->hdr_comment, ps, depth)) /* unknown string */
return False;
if(!smb_io_unihdr("hdr_munged_dial ", &usr->hdr_munged_dial, ps, depth)) /* wkstas user can log on from */
return False;
if(!smb_io_unistr2("uni_workstations", &usr->uni_workstations, usr->hdr_workstations.buffer, ps, depth)) /* worksations user can log on from */
return False;
- if(!smb_io_unistr2("uni_unknown_str ", &usr->uni_unknown_str, usr->hdr_unknown_str.buffer, ps, depth)) /* unknown string */
+ if(!smb_io_unistr2("uni_comment ", &usr->uni_comment, usr->hdr_comment.buffer, ps, depth)) /* unknown string */
return False;
if(!smb_io_unistr2("uni_munged_dial ", &usr->uni_munged_dial, usr->hdr_munged_dial.buffer, ps, depth))
way than normal... And there are definately other problems. JRA.
********************************************************************/
-static BOOL sam_io_user_info25(const char *desc, SAM_USER_INFO_25 * usr, prs_struct *ps, int depth)
+static bool sam_io_user_info25(const char *desc, SAM_USER_INFO_25 * usr, prs_struct *ps, int depth)
{
if (usr == NULL)
return False;
return False;
if(!smb_io_unihdr("hdr_workstations", &usr->hdr_workstations, ps, depth)) /* wkstas user can log on from */
return False;
- if(!smb_io_unihdr("hdr_unknown_str ", &usr->hdr_unknown_str, ps, depth)) /* unknown string */
+ if(!smb_io_unihdr("hdr_comment ", &usr->hdr_comment, ps, depth)) /* unknown string */
return False;
if(!smb_io_unihdr("hdr_munged_dial ", &usr->hdr_munged_dial, ps, depth)) /* wkstas user can log on from */
return False;
return False;
if(!prs_uint32("acb_info ", ps, depth, &usr->acb_info))
return False;
+ if(!prs_uint32("fields_present ", ps, depth, &usr->fields_present))
+ return False;
+
+ if(!prs_uint16("logon_divs ", ps, depth, &usr->logon_divs)) /* logon divisions per week */
+ return False;
+ if(!prs_align(ps))
+ return False;
+ if(!prs_uint32("ptr_logon_hrs ", ps, depth, &usr->ptr_logon_hrs))
+ return False;
+
+ if(!prs_uint16("bad_password_count ", ps, depth, &usr->bad_password_count))
+ return False;
+ if(!prs_uint16("logon_count ", ps, depth, &usr->logon_count))
+ return False;
- if(!prs_uint32s(False, "unknown_6 ", ps, depth, usr->unknown_6, 6))
+ if(!prs_uint8s(False, "padding1 ", ps, depth, usr->padding1, sizeof(usr->padding1)))
+ return False;
+ if(!prs_uint8("passmustchange ", ps, depth, &usr->passmustchange))
+ return False;
+ if(!prs_uint8("padding2 ", ps, depth, &usr->padding2))
return False;
+
if(!prs_uint8s(False, "password ", ps, depth, usr->pass, sizeof(usr->pass)))
return False;
if(!smb_io_unistr2("uni_workstations", &usr->uni_workstations, usr->hdr_workstations.buffer, ps, depth)) /* worksations user can log on from */
return False;
- if(!smb_io_unistr2("uni_unknown_str ", &usr->uni_unknown_str, usr->hdr_unknown_str.buffer, ps, depth)) /* unknown string */
+ if(!smb_io_unistr2("uni_comment ", &usr->uni_comment, usr->hdr_comment.buffer, ps, depth)) /* unknown string */
return False;
if(!smb_io_unistr2("uni_munged_dial ", &usr->uni_munged_dial, usr->hdr_munged_dial.buffer, ps, depth))
return False;
-#if 0 /* JRA - unknown... */
/* ok, this is only guess-work (as usual) */
if (usr->ptr_logon_hrs) {
if(!sam_io_logon_hrs("logon_hrs", &usr->logon_hrs, ps, depth))
return False;
}
-#endif
return True;
}
copy_unistr2(&usr->uni_workstations, wkstas);
init_uni_hdr(&usr->hdr_workstations, &usr->uni_workstations);
- copy_unistr2(&usr->uni_unknown_str, unk_str);
- init_uni_hdr(&usr->hdr_unknown_str, &usr->uni_unknown_str);
+ copy_unistr2(&usr->uni_comment, unk_str);
+ init_uni_hdr(&usr->hdr_comment, &usr->uni_comment);
copy_unistr2(&usr->uni_munged_dial, mung_dial);
init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial);
pass_last_set_time, pass_can_change_time,
pass_must_change_time;
+ time_t must_change_time;
const char* user_name = pdb_get_username(pw);
const char* full_name = pdb_get_fullname(pw);
const char* home_dir = pdb_get_homedir(pw);
if (munged_dial) {
munged_dial_blob = base64_decode_data_blob(munged_dial);
} else {
- munged_dial_blob = data_blob(NULL, 0);
+ munged_dial_blob = data_blob_null;
}
/* Create NTTIME structs */
- unix_to_nt_time (&logon_time, pdb_get_logon_time(pw));
- unix_to_nt_time (&logoff_time, pdb_get_logoff_time(pw));
+ unix_to_nt_time (&logon_time, pdb_get_logon_time(pw));
+ unix_to_nt_time (&logoff_time, pdb_get_logoff_time(pw));
unix_to_nt_time (&kickoff_time, pdb_get_kickoff_time(pw));
- unix_to_nt_time (&pass_last_set_time, pdb_get_pass_last_set_time(pw));
- unix_to_nt_time (&pass_can_change_time, pdb_get_pass_can_change_time(pw));
- unix_to_nt_time (&pass_must_change_time,pdb_get_pass_must_change_time(pw));
+ unix_to_nt_time (&pass_last_set_time, pdb_get_pass_last_set_time(pw));
+ unix_to_nt_time (&pass_can_change_time,pdb_get_pass_can_change_time(pw));
+ must_change_time = pdb_get_pass_must_change_time(pw);
+ if (must_change_time == get_time_t_max())
+ unix_to_nt_time_abs(&pass_must_change_time, must_change_time);
+ else
+ unix_to_nt_time(&pass_must_change_time, must_change_time);
/* structure assignment */
usr->logon_time = logon_time;
user_sid = pdb_get_user_sid(pw);
if (!sid_peek_check_rid(domain_sid, user_sid, &user_rid)) {
- fstring user_sid_string;
- fstring domain_sid_string;
DEBUG(0, ("init_sam_user_info_21A: User %s has SID %s, \nwhich conflicts with "
"the domain sid %s. Failing operation.\n",
- user_name,
- sid_to_string(user_sid_string, user_sid),
- sid_to_string(domain_sid_string, domain_sid)));
+ user_name, sid_string_dbg(user_sid),
+ sid_string_dbg(domain_sid)));
data_blob_free(&munged_dial_blob);
return NT_STATUS_UNSUCCESSFUL;
}
+ become_root();
group_sid = pdb_get_group_sid(pw);
-
+ unbecome_root();
+
if (!sid_peek_check_rid(domain_sid, group_sid, &group_rid)) {
- fstring group_sid_string;
- fstring domain_sid_string;
DEBUG(0, ("init_sam_user_info_21A: User %s has Primary Group SID %s, \n"
"which conflicts with the domain sid %s. Failing operation.\n",
- user_name,
- sid_to_string(group_sid_string, group_sid),
- sid_to_string(domain_sid_string, domain_sid)));
+ user_name, sid_string_dbg(group_sid),
+ sid_string_dbg(domain_sid)));
data_blob_free(&munged_dial_blob);
return NT_STATUS_UNSUCCESSFUL;
}
init_unistr2(&usr->uni_workstations, workstations, UNI_STR_TERMINATE);
init_uni_hdr(&usr->hdr_workstations, &usr->uni_workstations);
- init_unistr2(&usr->uni_unknown_str, NULL, UNI_STR_TERMINATE);
- init_uni_hdr(&usr->hdr_unknown_str, &usr->uni_unknown_str);
+ init_unistr2(&usr->uni_comment, NULL, UNI_STR_TERMINATE);
+ init_uni_hdr(&usr->hdr_comment, &usr->uni_comment);
init_unistr2_from_datablob(&usr->uni_munged_dial, &munged_dial_blob);
init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial);
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_user_info21(const char *desc, SAM_USER_INFO_21 * usr,
+static bool sam_io_user_info21(const char *desc, SAM_USER_INFO_21 * usr,
prs_struct *ps, int depth)
{
if (usr == NULL)
return False;
if(!smb_io_unihdr("hdr_workstations", &usr->hdr_workstations, ps, depth)) /* wkstas user can log on from */
return False;
- if(!smb_io_unihdr("hdr_unknown_str ", &usr->hdr_unknown_str, ps, depth)) /* unknown string */
+ if(!smb_io_unihdr("hdr_comment ", &usr->hdr_comment, ps, depth)) /* unknown string */
return False;
if(!smb_io_unihdr("hdr_munged_dial ", &usr->hdr_munged_dial, ps, depth)) /* wkstas user can log on from */
return False;
/* here begins pointed-to data */
- if(!smb_io_unistr2("uni_user_name ", &usr->uni_user_name,usr->hdr_user_name.buffer, ps, depth)) /* username unicode string */
+ if(!smb_io_unistr2("uni_user_name ", &usr->uni_user_name,usr->hdr_user_name.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_full_name ", &usr->uni_full_name, usr->hdr_full_name.buffer, ps, depth)) /* user's full name unicode string */
+ if(!smb_io_unistr2("uni_full_name ", &usr->uni_full_name, usr->hdr_full_name.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_home_dir ", &usr->uni_home_dir, usr->hdr_home_dir.buffer, ps, depth)) /* home directory unicode string */
+ if(!smb_io_unistr2("uni_home_dir ", &usr->uni_home_dir, usr->hdr_home_dir.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_dir_drive ", &usr->uni_dir_drive, usr->hdr_dir_drive.buffer, ps, depth)) /* home directory drive unicode string */
+ if(!smb_io_unistr2("uni_dir_drive ", &usr->uni_dir_drive, usr->hdr_dir_drive.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_logon_script", &usr->uni_logon_script, usr->hdr_logon_script.buffer, ps, depth)) /* logon script unicode string */
+ if(!smb_io_unistr2("uni_logon_script", &usr->uni_logon_script, usr->hdr_logon_script.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_profile_path", &usr->uni_profile_path, usr->hdr_profile_path.buffer, ps, depth)) /* profile path unicode string */
+ if(!smb_io_unistr2("uni_profile_path", &usr->uni_profile_path, usr->hdr_profile_path.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_acct_desc ", &usr->uni_acct_desc, usr->hdr_acct_desc.buffer, ps, depth)) /* user desc unicode string */
+ if(!smb_io_unistr2("uni_acct_desc ", &usr->uni_acct_desc, usr->hdr_acct_desc.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_workstations", &usr->uni_workstations, usr->hdr_workstations.buffer, ps, depth)) /* worksations user can log on from */
+ if(!smb_io_unistr2("uni_workstations", &usr->uni_workstations, usr->hdr_workstations.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_unknown_str ", &usr->uni_unknown_str, usr->hdr_unknown_str.buffer, ps, depth)) /* unknown string */
+ if(!smb_io_unistr2("uni_comment", &usr->uni_comment, usr->hdr_comment.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_munged_dial ", &usr->uni_munged_dial,usr->hdr_munged_dial.buffer, ps, depth)) /* worksations user can log on from */
+ if(!smb_io_unistr2("uni_munged_dial ", &usr->uni_munged_dial,usr->hdr_munged_dial.buffer, ps, depth))
return False;
/* ok, this is only guess-work (as usual) */
void init_sam_user_info20A(SAM_USER_INFO_20 *usr, struct samu *pw)
{
const char *munged_dial = pdb_get_munged_dial(pw);
- DATA_BLOB blob = base64_decode_data_blob(munged_dial);
-
+ DATA_BLOB blob;
+
+ if (munged_dial) {
+ blob = base64_decode_data_blob(munged_dial);
+ } else {
+ blob = data_blob_null;
+ }
+
init_unistr2_from_datablob(&usr->uni_munged_dial, &blob);
init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial);
data_blob_free(&blob);
reads or writes a structure.
********************************************************************/
-static BOOL sam_io_user_info20(const char *desc, SAM_USER_INFO_20 *usr,
+static bool sam_io_user_info20(const char *desc, SAM_USER_INFO_20 *usr,
prs_struct *ps, int depth)
{
if (usr == NULL)
switch (switch_value) {
case 0x18:
SamOEMhashBlob(ctr->info.id24->pass, 516, sess_key);
- dump_data(100, (char *)sess_key->data, sess_key->length);
- dump_data(100, (char *)ctr->info.id24->pass, 516);
+ dump_data(100, sess_key->data, sess_key->length);
+ dump_data(100, ctr->info.id24->pass, 516);
break;
case 0x17:
SamOEMhashBlob(ctr->info.id23->pass, 516, sess_key);
- dump_data(100, (char *)sess_key->data, sess_key->length);
- dump_data(100, (char *)ctr->info.id23->pass, 516);
+ dump_data(100, sess_key->data, sess_key->length);
+ dump_data(100, ctr->info.id23->pass, 516);
break;
case 0x07:
break;
reads or writes a structure.
********************************************************************/
-static BOOL samr_io_userinfo_ctr(const char *desc, SAM_USERINFO_CTR **ppctr,
+static bool samr_io_userinfo_ctr(const char *desc, SAM_USERINFO_CTR **ppctr,
prs_struct *ps, int depth)
{
- BOOL ret;
+ bool ret;
SAM_USERINFO_CTR *ctr;
prs_debug(ps, depth, desc, "samr_io_userinfo_ctr");
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_query_userinfo(const char *desc, SAMR_R_QUERY_USERINFO * r_u,
+bool samr_io_r_query_userinfo(const char *desc, SAMR_R_QUERY_USERINFO * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_set_userinfo(const char *desc, SAMR_Q_SET_USERINFO * q_u,
+bool samr_io_q_set_userinfo(const char *desc, SAMR_Q_SET_USERINFO * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_set_userinfo(const char *desc, SAMR_R_SET_USERINFO * r_u,
+bool samr_io_r_set_userinfo(const char *desc, SAMR_R_SET_USERINFO * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
q_u->switch_value = switch_value;
q_u->ctr = ctr;
- if (q_u->ctr != NULL)
- q_u->ctr->switch_value = switch_value;
+ q_u->ctr->switch_value = switch_value;
switch (switch_value) {
case 18:
SamOEMhashBlob(ctr->info.id18->lm_pwd, 16, sess_key);
SamOEMhashBlob(ctr->info.id18->nt_pwd, 16, sess_key);
- dump_data(100, (char *)sess_key->data, sess_key->length);
- dump_data(100, (char *)ctr->info.id18->lm_pwd, 16);
- dump_data(100, (char *)ctr->info.id18->nt_pwd, 16);
+ dump_data(100, sess_key->data, sess_key->length);
+ dump_data(100, ctr->info.id18->lm_pwd, 16);
+ dump_data(100, ctr->info.id18->nt_pwd, 16);
break;
}
}
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_set_userinfo2(const char *desc, SAMR_Q_SET_USERINFO2 * q_u,
+bool samr_io_q_set_userinfo2(const char *desc, SAMR_Q_SET_USERINFO2 * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_set_userinfo2(const char *desc, SAMR_R_SET_USERINFO2 * r_u,
+bool samr_io_r_set_userinfo2(const char *desc, SAMR_R_SET_USERINFO2 * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_connect(const char *desc, SAMR_Q_CONNECT * q_u,
+bool samr_io_q_connect(const char *desc, SAMR_Q_CONNECT * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_connect(const char *desc, SAMR_R_CONNECT * r_u,
+bool samr_io_r_connect(const char *desc, SAMR_R_CONNECT * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_connect4(const char *desc, SAMR_Q_CONNECT4 * q_u,
+bool samr_io_q_connect4(const char *desc, SAMR_Q_CONNECT4 * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_connect4(const char *desc, SAMR_R_CONNECT4 * r_u,
+bool samr_io_r_connect4(const char *desc, SAMR_R_CONNECT4 * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_connect5(const char *desc, SAMR_Q_CONNECT5 * q_u,
+bool samr_io_q_connect5(const char *desc, SAMR_Q_CONNECT5 * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_connect5(const char *desc, SAMR_R_CONNECT5 * r_u,
+bool samr_io_r_connect5(const char *desc, SAMR_R_CONNECT5 * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_connect_anon(const char *desc, SAMR_Q_CONNECT_ANON * q_u,
+bool samr_io_q_connect_anon(const char *desc, SAMR_Q_CONNECT_ANON * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_connect_anon(const char *desc, SAMR_R_CONNECT_ANON * r_u,
+bool samr_io_r_connect_anon(const char *desc, SAMR_R_CONNECT_ANON * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_get_dom_pwinfo(const char *desc, SAMR_Q_GET_DOM_PWINFO * q_u,
+bool samr_io_q_get_dom_pwinfo(const char *desc, SAMR_Q_GET_DOM_PWINFO * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_get_dom_pwinfo(const char *desc, SAMR_R_GET_DOM_PWINFO * r_u,
+bool samr_io_r_get_dom_pwinfo(const char *desc, SAMR_R_GET_DOM_PWINFO * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a SAMR_ENC_PASSWD structure.
********************************************************************/
-BOOL samr_io_enc_passwd(const char *desc, SAMR_ENC_PASSWD * pwd,
+bool samr_io_enc_passwd(const char *desc, SAMR_ENC_PASSWD * pwd,
prs_struct *ps, int depth)
{
if (pwd == NULL)
reads or writes a SAMR_ENC_HASH structure.
********************************************************************/
-BOOL samr_io_enc_hash(const char *desc, SAMR_ENC_HASH * hsh,
+bool samr_io_enc_hash(const char *desc, SAMR_ENC_HASH * hsh,
prs_struct *ps, int depth)
{
if (hsh == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_chgpasswd_user(const char *desc, SAMR_Q_CHGPASSWD_USER * q_u,
+bool samr_io_q_chgpasswd_user(const char *desc, SAMR_Q_CHGPASSWD_USER * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_chgpasswd_user(const char *desc, SAMR_R_CHGPASSWD_USER * r_u,
+bool samr_io_r_chgpasswd_user(const char *desc, SAMR_R_CHGPASSWD_USER * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_chgpasswd_user3(const char *desc, SAMR_Q_CHGPASSWD_USER3 * q_u,
+bool samr_io_q_chgpasswd_user3(const char *desc, SAMR_Q_CHGPASSWD_USER3 * q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
Reads or writes an SAMR_CHANGE_REJECT structure.
********************************************************************/
-BOOL samr_io_change_reject(const char *desc, SAMR_CHANGE_REJECT *reject, prs_struct *ps, int depth)
+bool samr_io_change_reject(const char *desc, SAMR_CHANGE_REJECT *reject, prs_struct *ps, int depth)
{
if (reject == NULL)
return False;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_chgpasswd_user3(const char *desc, SAMR_R_CHGPASSWD_USER3 *r_u,
+bool samr_io_r_chgpasswd_user3(const char *desc, SAMR_R_CHGPASSWD_USER3 *r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
if (!prs_uint32("ptr_info", ps, depth, &r_u->ptr_info))
return False;
+ /* special case: Windows 2000 can return stub data here saying
+ NT_STATUS_NOT_SUPPORTED */
+
+ if ( NT_STATUS_EQUAL( NT_STATUS_NOT_SUPPORTED, NT_STATUS(r_u->ptr_info)) ) {
+ r_u->status = NT_STATUS_NOT_SUPPORTED;
+ return True;
+ }
+
if (r_u->ptr_info && r_u->info != NULL) {
/* SAM_UNK_INFO_1 */
if (!sam_io_unk_info1("info", r_u->info, ps, depth))
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_query_domain_info2(const char *desc, SAMR_Q_QUERY_DOMAIN_INFO2 *q_u,
+bool samr_io_q_query_domain_info2(const char *desc, SAMR_Q_QUERY_DOMAIN_INFO2 *q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_query_domain_info2(const char *desc, SAMR_R_QUERY_DOMAIN_INFO2 * r_u,
+bool samr_io_r_query_domain_info2(const char *desc, SAMR_R_QUERY_DOMAIN_INFO2 * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)
return False;
switch (r_u->switch_value) {
+ case 0x0d:
+ if(!sam_io_unk_info13("unk_inf13", &r_u->ctr->info.inf13, ps, depth))
+ return False;
+ break;
case 0x0c:
if(!sam_io_unk_info12("unk_inf12", &r_u->ctr->info.inf12, ps, depth))
return False;
break;
+ case 0x09:
+ if(!sam_io_unk_info9("unk_inf9",&r_u->ctr->info.inf9, ps,depth))
+ return False;
+ break;
+ case 0x08:
+ if(!sam_io_unk_info8("unk_inf8",&r_u->ctr->info.inf8, ps,depth))
+ return False;
+ break;
case 0x07:
if(!sam_io_unk_info7("unk_inf7",&r_u->ctr->info.inf7, ps,depth))
return False;
if(!sam_io_unk_info5("unk_inf5",&r_u->ctr->info.inf5, ps,depth))
return False;
break;
+ case 0x04:
+ if(!sam_io_unk_info4("unk_inf4",&r_u->ctr->info.inf4, ps,depth))
+ return False;
+ break;
case 0x03:
if(!sam_io_unk_info3("unk_inf3",&r_u->ctr->info.inf3, ps,depth))
return False;
reads or writes a structure.
********************************************************************/
-BOOL samr_io_q_set_domain_info(const char *desc, SAMR_Q_SET_DOMAIN_INFO *q_u,
+bool samr_io_q_set_domain_info(const char *desc, SAMR_Q_SET_DOMAIN_INFO *q_u,
prs_struct *ps, int depth)
{
if (q_u == NULL)
reads or writes a structure.
********************************************************************/
-BOOL samr_io_r_set_domain_info(const char *desc, SAMR_R_SET_DOMAIN_INFO * r_u,
+bool samr_io_r_set_domain_info(const char *desc, SAMR_R_SET_DOMAIN_INFO * r_u,
prs_struct *ps, int depth)
{
if (r_u == NULL)