summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2005-11-23 22:08:57 +0000
committerJim McDonough <jmcd@samba.org>2005-11-23 22:08:57 +0000
commitc9d6f849de012583fefc87ba9a25d0b456557251 (patch)
tree30983d1170484f9220e9eb980c6b161fbd0d856c
parent57c54f5da5efd44b49a50967c6017e5e6cfb9d79 (diff)
downloadsamba-c9d6f849de012583fefc87ba9a25d0b456557251.tar.gz
samba-c9d6f849de012583fefc87ba9a25d0b456557251.tar.xz
samba-c9d6f849de012583fefc87ba9a25d0b456557251.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.
-rw-r--r--source/auth/auth_sam.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/auth/auth_sam.c b/source/auth/auth_sam.c
index c92cecdde59..558c181f704 100644
--- a/source/auth/auth_sam.c
+++ b/source/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;
}