Re: blank lines in ACL files [1.X & 2.X patch]

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 29 Oct 1998 23:37:04 +0100

Jim Deitch wrote:
>
> Maybe this ought to be in the FAQ. I found that under 1.1.22 if
> you have a blank line at the end of the file (/usr/local/squid/etc/adultdomain.dat)
> any and all access are blocked. Not sure why, but check to see
> if there is a blank line at the end of the file.

A empty line anywhere in a "file" counts as a empty acl tag, which
usually matches everything.

I have attached a small patch to this problem.

---
Henrik Nordstrom
Spare time Squid hacker

--- squid-1.1.22/src/acl.c.orig Thu Oct 29 23:28:42 1998
+++ squid-1.1.22/src/acl.c Thu Oct 29 23:29:09 1998
@@ -139,6 +139,9 @@
         /* skip leading and trailing white space */
         t += strspn(buf, w_space);
         t[strcspn(t, w_space)] = '\0';
+ /* skip blank lines */
+ if (!*t)
+ goto strtok_again;
         return (t);
     }
 }

Index: squid/src/acl.c
diff -u squid/src/acl.c:1.1.1.24.2.3 squid/src/acl.c:1.1.1.24.2.4
--- squid/src/acl.c:1.1.1.24.2.3 Fri Oct 23 02:12:34 1998
+++ squid/src/acl.c Thu Oct 29 23:23:53 1998
@@ -129,6 +129,9 @@
         /* skip leading and trailing white space */
         t += strspn(buf, w_space);
         t[strcspn(t, w_space)] = '\0';
+ /* skip blank lines */
+ if (!*t)
+ goto strtok_again;
         return t;
     }
 }
Received on Thu Oct 29 1998 - 16:10:17 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:42:51 MST