summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2005-11-23 22:08:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:33 -0500
commit43600a1d5808af6df72a90bf4fe951e3e7da4601 (patch)
treeb60674e729a4aa2c91ae86acc35b0aa737e3f80e /source3/auth
parent98cd8edc565cae464edd257bb811a792eea6849e (diff)
downloadsamba-43600a1d5808af6df72a90bf4fe951e3e7da4601.tar.gz
samba-43600a1d5808af6df72a90bf4fe951e3e7da4601.tar.bz2
samba-43600a1d5808af6df72a90bf4fe951e3e7da4601.zip
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)
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_sam.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c
index c92cecdde5..558c181f70 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;
}