From 43600a1d5808af6df72a90bf4fe951e3e7da4601 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Wed, 23 Nov 2005 22:08:57 +0000 Subject: [PATCH] r11886: Fix 3187: logon hours restrictions were off corresponding to our offset from GMT. Use gmtime() instead of localtime() in the calc, but still use localtime() in displaying it. (This used to be commit 9b34f2d0f4bfc623eaec9c1334e34fa3965ba25b) --- source3/auth/auth_sam.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c index c92cecdde59..558c181f704 100644 --- a/source3/auth/auth_sam.c +++ b/source3/auth/auth_sam.c @@ -88,7 +88,7 @@ static BOOL logon_hours_ok(SAM_ACCOUNT *sampass) } lasttime = (time_t)smb_last_time.tv_sec; - utctime = localtime(&lasttime); + utctime = gmtime(&lasttime); /* find the corresponding byte and bit */ bitpos = (utctime->tm_wday * 24 + utctime->tm_hour) % 168; @@ -96,7 +96,8 @@ static BOOL logon_hours_ok(SAM_ACCOUNT *sampass) if (! (hours[bitpos/8] & bitmask)) { DEBUG(1,("logon_hours_ok: Account for user %s not allowed to logon at this time (%s).\n", - pdb_get_username(sampass), asctime(utctime) )); + pdb_get_username(sampass), + asctime(localtime(&lasttime)) )); return False; } -- 2.11.4.GIT