From 58e2d6557c13e534f00f6efb67b6c19cd2e494f0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 12 Feb 2016 13:56:26 +0100 Subject: [PATCH] s4:dsdb/password_hash: use full NTTIME resolution for pwdLastSet Windows does the same... BUG: https://bugzilla.samba.org/show_bug.cgi?id=9654 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/password_hash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index 05b08547437b..492448bf8c1b 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -1687,6 +1687,7 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) static int setup_last_set_field(struct setup_password_fields_io *io) { const struct ldb_message *msg = NULL; + struct timeval tv = { .tv_sec = 0 }; switch (io->ac->req->operation) { case LDB_ADD: @@ -1717,7 +1718,8 @@ static int setup_last_set_field(struct setup_password_fields_io *io) } /* set it as now */ - unix_to_nt_time(&io->g.last_set, time(NULL)); + GetTimeOfDay(&tv); + io->g.last_set = timeval_to_nttime(&tv); return LDB_SUCCESS; } -- 2.34.1