/*
- * $Id: acl.cc,v 1.56 1996/11/02 00:17:40 wessels Exp $
+ * $Id: acl.cc,v 1.57 1996/11/04 17:04:14 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
static void aclDestroyAclList _PARAMS((struct _acl_list * list));
static void aclDestroyIpList _PARAMS((struct _acl_ip_data * data));
-static void aclDestroyRegexList _PARAMS((struct _relist * data));
static void aclDestroyTimeList _PARAMS((struct _acl_time_data * data));
static int aclMatchDomainList _PARAMS((wordlist *, char *));
static int aclMatchAclList _PARAMS((struct _acl_list *, aclCheck_t *));
static int aclMatchInteger _PARAMS((intlist * data, int i));
static int aclMatchIp _PARAMS((struct _acl_ip_data * data, struct in_addr c));
-static int aclMatchRegex _PARAMS((relist * data, char *word));
static int aclMatchTime _PARAMS((struct _acl_time_data * data, time_t when));
static intlist *aclParseIntlist _PARAMS((void));
static struct _acl_ip_data *aclParseIpList _PARAMS((void));
static intlist *aclParseMethodList _PARAMS((void));
static intlist *aclParseProtoList _PARAMS((void));
-static struct _relist *aclParseRegexList _PARAMS((void));
static struct _acl_time_data *aclParseTimeSpec _PARAMS((void));
static wordlist *aclParseWordList _PARAMS((void));
static wordlist *aclParseDomainList _PARAMS((void));
return data;
}
-static struct _relist *
-aclParseRegexList(void)
+struct _relist *
+aclParseRegexList(int icase)
{
relist *head = NULL;
relist **Tail = &head;
relist *q = NULL;
char *t = NULL;
regex_t comp;
+ int flags = REG_EXTENDED;
+ if (icase)
+ flags |= REG_ICASE;
while ((t = strtokFile())) {
- if (regcomp(&comp, t, REG_EXTENDED) != REG_NOERROR) {
+ if (regcomp(&comp, t, flags) != REG_NOERROR) {
debug(28, 0, "%s line %d: %s\n",
cfg_filename, config_lineno, config_input_line);
debug(28, 0, "aclParseRegexList: Invalid regular expression: '%s'\n", t);
break;
case ACL_URL_REGEX:
case ACL_URLPATH_REGEX:
- A->data = (void *) aclParseRegexList();
+ A->data = (void *) aclParseRegexList(0);
break;
case ACL_URL_PORT:
A->data = (void *) aclParseIntlist();
A->data = (void *) aclParseMethodList();
break;
case ACL_BROWSER:
- A->data = (void *) aclParseRegexList();
+ A->data = (void *) aclParseRegexList(0);
break;
case ACL_NONE:
default:
return 0;
}
-static int
+int
aclMatchRegex(relist * data, char *word)
{
relist *first, *prev;
}
}
-static void
+void
aclDestroyRegexList(struct _relist *data)
{
struct _relist *next = NULL;
/*
- * $Id: cache_cf.cc,v 1.124 1996/11/02 00:17:43 wessels Exp $
+ * $Id: cache_cf.cc,v 1.125 1996/11/04 17:04:16 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
#if DELAY_HACK
aclDestroyAccessList(&DelayAccessList);
#endif
+ aclDestroyRegexList(Config.cache_stop_relist);
+ Config.cache_stop_relist = NULL;
if ((fp = fopen(file_name, "r")) == NULL) {
sprintf(fatal_str, "Unable to open configuration file: %s: %s",
else if (!strcmp(token, "cache_stoplist"))
parseWordlist(&Config.cache_stoplist);
+ else if (!strcmp(token, "cache_stoplist_pattern"))
+ Config.cache_stop_relist = aclParseRegexList(0);
+ else if (!strcmp(token, "cache_stoplist_pattern/i"))
+ Config.cache_stop_relist = aclParseRegexList(1);
#if DELAY_HACK
else if (!strcmp(token, "delay_access"))