From 9a36fabde0e212b06c2b44db157070b7debdb06b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 31 Mar 2014 13:35:25 +0200 Subject: s4:auth/sam: use a higher time resolution in authsam_account_ok() Change-Id: I2961e7311f31e239a6768f56437e5c112a7a9bb0 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/auth/sam.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/auth/sam.c') diff --git a/source4/auth/sam.c b/source4/auth/sam.c index 72c57b92c81..8729ec59bb4 100644 --- a/source4/auth/sam.c +++ b/source4/auth/sam.c @@ -165,8 +165,9 @@ _PUBLIC_ NTSTATUS authsam_account_ok(TALLOC_CTX *mem_ctx, const char *workstation_list; NTTIME acct_expiry; NTTIME must_change_time; + struct timeval tv_now = timeval_current(); + NTTIME now = timeval_to_nttime(&tv_now); - NTTIME now; DEBUG(4,("authsam_account_ok: Checking SMB password for user %s\n", name_for_logs)); acct_flags = samdb_result_acct_flags(sam_ctx, mem_ctx, msg, domain_dn); @@ -193,7 +194,6 @@ _PUBLIC_ NTSTATUS authsam_account_ok(TALLOC_CTX *mem_ctx, } /* Test account expire time */ - unix_to_nt_time(&now, time(NULL)); if (now > acct_expiry) { DEBUG(2,("authsam_account_ok: Account for user '%s' has expired.\n", name_for_logs)); DEBUG(3,("authsam_account_ok: Account expired at '%s'.\n", -- cgit