mirror of
https://github.com/samba-team/samba.git
synced 2025-02-12 21:58:10 +03:00
torture-samr: Add test for lockout with and without a password history
Change-Id: I6f4b3e92feabe4ff09839329b0db3d33cc6c73b4 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
3c731783e0
commit
6a4bedd36a
@ -4115,13 +4115,13 @@ static bool test_Password_lockout(struct dcerpc_pipe *p,
|
||||
const char *comment,
|
||||
bool disable,
|
||||
bool interactive,
|
||||
uint32_t password_history_length,
|
||||
NTSTATUS expected_success_status,
|
||||
struct samr_DomInfo1 *info1,
|
||||
struct samr_DomInfo12 *info12)
|
||||
{
|
||||
union samr_DomainInfo info;
|
||||
uint32_t badpwdcount;
|
||||
uint32_t password_history_length = 1;
|
||||
uint64_t lockout_threshold = 1;
|
||||
uint32_t lockout_seconds = 5;
|
||||
uint64_t delta_time_factor = 10 * 1000 * 1000;
|
||||
@ -4137,7 +4137,7 @@ static bool test_Password_lockout(struct dcerpc_pipe *p,
|
||||
|
||||
info.info1 = *info1;
|
||||
|
||||
torture_comment(tctx, "setting password history length.\n");
|
||||
torture_comment(tctx, "setting password history length to %d.\n", password_history_length);
|
||||
info.info1.password_history_length = password_history_length;
|
||||
|
||||
torture_comment(tctx, "setting min password again.\n");
|
||||
@ -4315,6 +4315,7 @@ static bool test_Password_lockout_wrap(struct dcerpc_pipe *p,
|
||||
const char *comment;
|
||||
bool disabled;
|
||||
bool interactive;
|
||||
uint32_t password_history_length;
|
||||
NTSTATUS expected_success_status;
|
||||
} creds[] = {
|
||||
{
|
||||
@ -4329,6 +4330,13 @@ static bool test_Password_lockout_wrap(struct dcerpc_pipe *p,
|
||||
.interactive = false,
|
||||
.expected_success_status= NT_STATUS_OK
|
||||
},
|
||||
{
|
||||
.comment = "network logon (enabled account, history len = 1)",
|
||||
.disabled = false,
|
||||
.interactive = false,
|
||||
.expected_success_status= NT_STATUS_OK,
|
||||
.password_history_length = 1
|
||||
},
|
||||
{
|
||||
.comment = "interactive logon (disabled account)",
|
||||
.disabled = true,
|
||||
@ -4341,6 +4349,13 @@ static bool test_Password_lockout_wrap(struct dcerpc_pipe *p,
|
||||
.interactive = true,
|
||||
.expected_success_status= NT_STATUS_OK
|
||||
},
|
||||
{
|
||||
.comment = "interactive logon (enabled account, history len = 1)",
|
||||
.disabled = false,
|
||||
.interactive = true,
|
||||
.expected_success_status= NT_STATUS_OK,
|
||||
.password_history_length = 1
|
||||
},
|
||||
};
|
||||
|
||||
torture_assert(tctx, setup_schannel_netlogon_pipe(tctx, machine_credentials, &np), "");
|
||||
@ -4380,6 +4395,7 @@ static bool test_Password_lockout_wrap(struct dcerpc_pipe *p,
|
||||
creds[i].comment,
|
||||
creds[i].disabled,
|
||||
creds[i].interactive,
|
||||
creds[i].password_history_length,
|
||||
creds[i].expected_success_status,
|
||||
&_info1, &_info12);
|
||||
ret &= test_passed;
|
||||
|
Loading…
x
Reference in New Issue
Block a user