diff options
author | Günther Deschner <gd@samba.org> | 2009-05-08 22:01:55 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-05-08 22:14:50 +0200 |
commit | 67df4489e20f17c334544818227e905136b6f5aa (patch) | |
tree | f43871ed9c6373271512671fdd2a43052bc06c46 /source4/torture | |
parent | 3d6f4a7af7b91d9f9ac9fd0b00af63bb23e371f7 (diff) | |
download | samba-67df4489e20f17c334544818227e905136b6f5aa.tar.gz samba-67df4489e20f17c334544818227e905136b6f5aa.tar.bz2 samba-67df4489e20f17c334544818227e905136b6f5aa.zip |
s4-smbtorture: Support timestamp handling for Samba3 in RPC-SAMR-USERS.
Timestamps in passdb (currently) only have second granularity.
Guenther
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/samr.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 428bc453da..03f900113d 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -439,14 +439,29 @@ static bool test_SetUserInfo(struct dcerpc_pipe *p, struct torture_context *tctx SAMR_FIELD_CODE_PAGE); } - TEST_USERINFO_INT(17, acct_expiry, 21, acct_expiry, __LINE__, 0); - TEST_USERINFO_INT(17, acct_expiry, 5, acct_expiry, __LINE__, 0); - TEST_USERINFO_INT(21, acct_expiry, 21, acct_expiry, __LINE__, - SAMR_FIELD_ACCT_EXPIRY); - TEST_USERINFO_INT(21, acct_expiry, 5, acct_expiry, __LINE__, - SAMR_FIELD_ACCT_EXPIRY); - TEST_USERINFO_INT(21, acct_expiry, 17, acct_expiry, __LINE__, - SAMR_FIELD_ACCT_EXPIRY); + if (!torture_setting_bool(tctx, "samba3", false)) { + TEST_USERINFO_INT(17, acct_expiry, 21, acct_expiry, __LINE__, 0); + TEST_USERINFO_INT(17, acct_expiry, 5, acct_expiry, __LINE__, 0); + TEST_USERINFO_INT(21, acct_expiry, 21, acct_expiry, __LINE__, + SAMR_FIELD_ACCT_EXPIRY); + TEST_USERINFO_INT(21, acct_expiry, 5, acct_expiry, __LINE__, + SAMR_FIELD_ACCT_EXPIRY); + TEST_USERINFO_INT(21, acct_expiry, 17, acct_expiry, __LINE__, + SAMR_FIELD_ACCT_EXPIRY); + } else { + /* Samba 3 can only store seconds / time_t in passdb - gd */ + NTTIME nt; + unix_to_nt_time(&nt, time(NULL) + __LINE__); + TEST_USERINFO_INT(17, acct_expiry, 21, acct_expiry, nt, 0); + unix_to_nt_time(&nt, time(NULL) + __LINE__); + TEST_USERINFO_INT(17, acct_expiry, 5, acct_expiry, nt, 0); + unix_to_nt_time(&nt, time(NULL) + __LINE__); + TEST_USERINFO_INT(21, acct_expiry, 21, acct_expiry, nt, SAMR_FIELD_ACCT_EXPIRY); + unix_to_nt_time(&nt, time(NULL) + __LINE__); + TEST_USERINFO_INT(21, acct_expiry, 5, acct_expiry, nt, SAMR_FIELD_ACCT_EXPIRY); + unix_to_nt_time(&nt, time(NULL) + __LINE__); + TEST_USERINFO_INT(21, acct_expiry, 17, acct_expiry, nt, SAMR_FIELD_ACCT_EXPIRY); + } TEST_USERINFO_INT(4, logon_hours.bits[3], 3, logon_hours.bits[3], 1, 0); TEST_USERINFO_INT(4, logon_hours.bits[3], 5, logon_hours.bits[3], 2, 0); |