*
* 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"
u_2->seq_num = seq_num;
-
+
u_2->unknown_4 = 0x00000001;
u_2->server_role = server_role;
u_2->unknown_6 = 0x00000001;
return True;
}
-/*******************************************************************
-inits a SAMR_Q_GET_DISPENUM_INDEX structure.
-********************************************************************/
-
-void init_samr_q_get_dispenum_index(SAMR_Q_GET_DISPENUM_INDEX * q_e, POLICY_HND *pol,
- uint16 switch_level, const char *name)
-{
- DEBUG(5, ("init_samr_q_get_dispenum_index\n"));
-
- q_e->domain_pol = *pol;
-
- q_e->switch_level = switch_level;
-
- init_lsa_string(&q_e->name, name);
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-BOOL samr_io_q_get_dispenum_index(const char *desc, SAMR_Q_GET_DISPENUM_INDEX * q_e,
- prs_struct *ps, int depth)
-{
- if (q_e == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "samr_io_q_get_dispenum_index");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_pol_hnd("domain_pol", &q_e->domain_pol, ps, depth))
- return False;
-
- if(!prs_uint16("switch_level", ps, depth, &q_e->switch_level))
- return False;
-
- if (!smb_io_lsa_string("name", &q_e->name, ps, depth))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-BOOL samr_io_r_get_dispenum_index(const char *desc, SAMR_R_GET_DISPENUM_INDEX * r_u,
- prs_struct *ps, int depth)
-{
- if (r_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "samr_io_r_get_dispenum_index");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("idx", ps, depth, &r_u->idx))
- return False;
-
- if(!prs_ntstatus("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-
/*******************************************************************
inits a SAMR_Q_OPEN_GROUP structure.
********************************************************************/
r_u->ptr_rids = 1;
r_u->num_rids2 = num_rids;
- if (num_rids) {
- if (!(r_u->rids = TALLOC_ZERO_ARRAY(ctx, uint32, num_rids)))
- return NT_STATUS_NO_MEMORY;
- if (!(r_u->types = TALLOC_ZERO_ARRAY(ctx, uint32, num_rids)))
- return NT_STATUS_NO_MEMORY;
- } else {
- r_u->rids = NULL;
- r_u->types = NULL;
- }
-
- if (!r_u->rids || !r_u->types)
- goto empty;
+ if (!(r_u->rids = TALLOC_ZERO_ARRAY(ctx, uint32, num_rids)))
+ return NT_STATUS_NO_MEMORY;
+ if (!(r_u->types = TALLOC_ZERO_ARRAY(ctx, uint32, num_rids)))
+ return NT_STATUS_NO_MEMORY;
for (i = 0; i < num_rids; i++) {
r_u->rids[i] = rid[i];
}
} else {
- empty:
r_u->num_types1 = 0;
r_u->ptr_types = 0;
r_u->num_types2 = 0;
}
}
+
+/*************************************************************************
+ 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.
********************************************************************/
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 */