]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make time ACLs behave like all other acls, accepting a list of times
authorhno <>
Sat, 8 Feb 2003 22:54:36 +0000 (22:54 +0000)
committerhno <>
Sat, 8 Feb 2003 22:54:36 +0000 (22:54 +0000)
(the parser already does, but the acl check never looked at more than the first)

src/acl.cc

index ef840c18fcf5cee3787b8bc8735621bff18c4d81..8a21f2717df862ee578fafd3da8e960bcc5fba97 100644 (file)
@@ -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