From 0b57d36ae32cfe3fb2d2517bdaeeb80816ba28ee Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 27 Jun 2012 14:36:31 +1000 Subject: [PATCH] s3-pdbtest: Initialise more elements for testing If these were left as defaults, they cause issues when the backend (pdb_samba4) returns the internal defaults from the directory, not the defaults from samu_new() Andrew Bartlett --- source3/torture/pdbtest.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source3/torture/pdbtest.c b/source3/torture/pdbtest.c index aad66bc0c85..c4c6bb68716 100644 --- a/source3/torture/pdbtest.c +++ b/source3/torture/pdbtest.c @@ -390,6 +390,8 @@ int main(int argc, char **argv) pdb_set_homedir(out, "\\\\torture\\home", PDB_SET); pdb_set_logon_script(out, "torture_script.cmd", PDB_SET); + pdb_set_acct_ctrl(out, ACB_NORMAL, PDB_SET); + pdb_get_account_policy(PDB_POLICY_PASSWORD_HISTORY, &history); if (history * PW_HISTORY_ENTRY_LEN < NT_HASH_LEN) { buf = (uint8 *)TALLOC(ctx, NT_HASH_LEN); @@ -423,6 +425,12 @@ int main(int argc, char **argv) pdb_set_pass_can_change_time(out, time(NULL)+min_age, PDB_SET); } + pdb_set_logon_time(out, time(NULL)-3600, PDB_SET); + + pdb_set_logoff_time(out, time(NULL), PDB_SET); + + pdb_set_kickoff_time(out, time(NULL)+3600, PDB_SET); + /* Create account */ if (!NT_STATUS_IS_OK(rv = pdb->add_sam_account(pdb, out))) { fprintf(stderr, "Error in add_sam_account: %s\n", -- 2.34.1