From: Stefan Metzmacher Date: Fri, 12 Feb 2016 12:56:26 +0000 (+0100) Subject: s4:dsdb/password_hash: use full NTTIME resolution for pwdLastSet X-Git-Tag: tdb-1.3.10~676 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=58e2d6557c13e534f00f6efb67b6c19cd2e494f0;p=thirdparty%2Fsamba.git 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 --- diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index 05b08547437..492448bf8c1 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; }