From: hno <> Date: Sat, 8 Feb 2003 22:54:36 +0000 (+0000) Subject: Make time ACLs behave like all other acls, accepting a list of times X-Git-Tag: SQUID_3_0_PRE1~375 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bdbd6dc616e85f8d22f2284ae069fdc354f6f132;p=thirdparty%2Fsquid.git Make time ACLs behave like all other acls, accepting a list of times (the parser already does, but the acl check never looked at more than the first) --- diff --git a/src/acl.cc b/src/acl.cc index ef840c18fc..8a21f2717d 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,5 +1,5 @@ /* - * $Id: acl.cc,v 1.298 2003/02/08 01:45:47 robertc Exp $ + * $Id: acl.cc,v 1.299 2003/02/08 15:54:36 hno Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -1502,9 +1502,12 @@ aclMatchTime(acl_time_data * data, time_t when) debug(28, 3) ("aclMatchTime: checking %d in %d-%d, weekbits=%x\n", (int) t, (int) data->start, (int) data->stop, data->weekbits); - if (t < data->start || t > data->stop) - return 0; - return data->weekbits & (1 << tm.tm_wday) ? 1 : 0; + while (data) { + if (t >= data->start && t <= data->stop && (data->weekbits & (1 << tm.tm_wday))) + return 1; + data = data->next; + } + return 0; } #if SQUID_SNMP