1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-18 00:23:50 +03:00

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 commit is contained in:
Jim McDonough
2005-11-23 22:08:57 +00:00
committed by Gerald (Jerry) Carter
parent 3ccea032cb
commit 9b34f2d0f4

View File

@@ -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;
}