mirror of
https://github.com/samba-team/samba.git
synced 2025-01-14 19:24:43 +03:00
Add some helper init routines for samr_DomInfo structures.
They will probably move to another place later. Guenther
This commit is contained in:
parent
bc047ee520
commit
0e1386f748
@ -66,6 +66,149 @@ bool samr_io_q_query_domain_info(const char *desc, SAMR_Q_QUERY_DOMAIN_INFO * q_
|
|||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
inits a structure.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
static void init_lsa_String(struct lsa_String *name, const char *s)
|
||||||
|
{
|
||||||
|
name->string = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
inits a structure.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
void init_samr_DomInfo1(struct samr_DomInfo1 *r,
|
||||||
|
uint16_t min_password_length,
|
||||||
|
uint16_t password_history_length,
|
||||||
|
uint32_t password_properties,
|
||||||
|
int64_t max_password_age,
|
||||||
|
int64_t min_password_age)
|
||||||
|
{
|
||||||
|
r->min_password_length = min_password_length;
|
||||||
|
r->password_history_length = password_history_length;
|
||||||
|
r->password_properties = password_properties;
|
||||||
|
r->max_password_age = max_password_age;
|
||||||
|
r->min_password_age = min_password_age;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
inits a structure.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
void init_samr_DomInfo2(struct samr_DomInfo2 *r,
|
||||||
|
NTTIME force_logoff_time,
|
||||||
|
const char *comment,
|
||||||
|
const char *domain_name,
|
||||||
|
const char *primary,
|
||||||
|
uint64_t sequence_num,
|
||||||
|
uint32_t unknown2,
|
||||||
|
enum samr_Role role,
|
||||||
|
uint32_t unknown3,
|
||||||
|
uint32_t num_users,
|
||||||
|
uint32_t num_groups,
|
||||||
|
uint32_t num_aliases)
|
||||||
|
{
|
||||||
|
r->force_logoff_time = force_logoff_time;
|
||||||
|
init_lsa_String(&r->comment, comment);
|
||||||
|
init_lsa_String(&r->domain_name, domain_name);
|
||||||
|
init_lsa_String(&r->primary, primary);
|
||||||
|
r->sequence_num = sequence_num;
|
||||||
|
r->unknown2 = unknown2;
|
||||||
|
r->role = role;
|
||||||
|
r->unknown3 = unknown3;
|
||||||
|
r->num_users = num_users;
|
||||||
|
r->num_groups = num_groups;
|
||||||
|
r->num_aliases = num_aliases;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
inits a structure.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
void init_samr_DomInfo3(struct samr_DomInfo3 *r,
|
||||||
|
NTTIME force_logoff_time)
|
||||||
|
{
|
||||||
|
r->force_logoff_time = force_logoff_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
inits a structure.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
void init_samr_DomInfo4(struct samr_DomInfo4 *r,
|
||||||
|
const char *comment)
|
||||||
|
{
|
||||||
|
init_lsa_String(&r->comment, comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
inits a structure.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
void init_samr_DomInfo5(struct samr_DomInfo5 *r,
|
||||||
|
const char *domain_name)
|
||||||
|
{
|
||||||
|
init_lsa_String(&r->domain_name, domain_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
inits a structure.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
void init_samr_DomInfo6(struct samr_DomInfo6 *r,
|
||||||
|
const char *primary)
|
||||||
|
{
|
||||||
|
init_lsa_String(&r->primary, primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
inits a structure.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
void init_samr_DomInfo7(struct samr_DomInfo7 *r,
|
||||||
|
enum samr_Role role)
|
||||||
|
{
|
||||||
|
r->role = role;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
inits a structure.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
void init_samr_DomInfo8(struct samr_DomInfo8 *r,
|
||||||
|
uint64_t sequence_num,
|
||||||
|
NTTIME domain_create_time)
|
||||||
|
{
|
||||||
|
r->sequence_num = sequence_num;
|
||||||
|
r->domain_create_time = domain_create_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
inits a structure.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
void init_samr_DomInfo9(struct samr_DomInfo9 *r,
|
||||||
|
uint32_t unknown)
|
||||||
|
{
|
||||||
|
r->unknown = unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
inits a structure.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
void init_samr_DomInfo12(struct samr_DomInfo12 *r,
|
||||||
|
uint64_t lockout_duration,
|
||||||
|
uint64_t lockout_window,
|
||||||
|
uint16_t lockout_threshold)
|
||||||
|
{
|
||||||
|
r->lockout_duration = lockout_duration;
|
||||||
|
r->lockout_window = lockout_window;
|
||||||
|
r->lockout_threshold = lockout_threshold;
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
inits a structure.
|
inits a structure.
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user