summaryrefslogtreecommitdiffstats
path: root/source4/auth/sam.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-03-31 13:35:25 +0200
committerStefan Metzmacher <metze@samba.org>2014-04-02 17:12:46 +0200
commit9a36fabde0e212b06c2b44db157070b7debdb06b (patch)
tree8a1bc7f4a0f7c058e7a8a079d7e6e4bd4c372d8c /source4/auth/sam.c
parent5c1cfe267ce10180e2c42105a1d84f84e7512c8d (diff)
downloadsamba-9a36fabde0e212b06c2b44db157070b7debdb06b.tar.gz
samba-9a36fabde0e212b06c2b44db157070b7debdb06b.tar.xz
samba-9a36fabde0e212b06c2b44db157070b7debdb06b.zip
s4:auth/sam: use a higher time resolution in authsam_account_ok()
Change-Id: I2961e7311f31e239a6768f56437e5c112a7a9bb0 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/auth/sam.c')
-rw-r--r--source4/auth/sam.c4
1 files changed, 2 insertions, 2 deletions
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",