-const char filters_rcs[] = "$Id: filters.c,v 1.1 2001/05/13 21:57:06 administrator Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.1.1.1 2001/05/15 13:58:52 oes Exp $";
/*********************************************************************
*
- * File : $Source: /home/administrator/cvs/ijb/filters.c,v $
+ * File : $Source: /cvsroot/ijbswa/current/filters.c,v $
*
* Purpose : Declares functions to parse/crunch headers and pages.
* Functions declared include:
* `acl_addr', `add_stats', `block_acl', `block_imageurl',
- * `block_url', `cookie_url', `domaincmp', `dsplit',
+ * `block_url', `url_permissions', `domaincmp', `dsplit',
* `filter_popups', `forward_url',
* `ij_untrusted_url', `intercept_url', `re_process_buffer',
* `show_proxy_args', and `trust_url'
*
* Revisions :
* $Log: filters.c,v $
+ * Revision 1.1.1.1 2001/05/15 13:58:52 oes
+ * Initial import of version 2.9.3 source tree
+ *
*
*********************************************************************/
\f
struct re_filterfile_spec *b;
/* Sanity first ;-) */
- if (size <= 0) return;
+ if (size <= 0)\r
+ {\r
+ return;\r
+ }
if ( ( NULL == (fl = csp->rlist) ) || ( NULL == (b = fl->f) ) )
{
joblist = b->joblist;
- log_error(LOG_LEVEL_REF, "re_filtering %s%s (size %d) ...",
+ log_error(LOG_LEVEL_RE_FILTER, "re_filtering %s%s (size %d) ...",
csp->http->hostport, csp->http->path, size);
/* Apply all jobs from the joblist */
old=new;
}
- log_error(LOG_LEVEL_REF, " produced %d hits (new size %d).", hits, size);
+ log_error(LOG_LEVEL_RE_FILTER, " produced %d hits (new size %d).", hits, size);
if (write_socket(csp->cfd, old, size) != size)
{
/*********************************************************************
*
- * Function : cookie_url
+ * Function : url_permissions
*
- * Description : Accept this cookie, or no? See "cookiefile" setting.
+ * Description : Gets the permissions for this URL.
*
* Parameters :
* 1 : http = http_request request for blocked URLs
* 2 : csp = Current client state (buffers, headers, etc...)
*
- * Returns : NULL => accept, cookie_spec pointer to crunch.
+ * Returns : permissions bitmask specifiying what this URL can do.\r
+ * If not on list, will be default_permissions.
*
*********************************************************************/
-struct cookie_spec *cookie_url(struct http_request *http, struct client_state *csp)
+int url_permissions(struct http_request *http, struct client_state *csp)
{
struct file_list *fl;
- struct cookie_spec *b;
+ struct permissions_spec *b;
struct url_spec url[1];
- if (((fl = csp->clist) == NULL) || ((b = fl->f) == NULL))
+ if (((fl = csp->permissions_list) == NULL) || ((b = fl->f) == NULL))
{
- return(NULL);
+ return(default_permissions);
}
*url = dsplit(http->host);
/* if splitting the domain fails, punt */
- if (url->dbuf == NULL) return(NULL);
+ if (url->dbuf == NULL)\r
+ {\r
+ return(default_permissions);\r
+ }
for (b = b->next; NULL != b; b = b->next)
{
{
freez(url->dbuf);
freez(url->dvec);
- return(b);
+ return(b->permissions);
}
}
}
freez(url->dbuf);
freez(url->dvec);
- return(NULL);
+ return(default_permissions);
}
file_description = "Block List";
}
break;
- case 'c':
- if (csp->clist)
+ case 'p':
+ if (csp->permissions_list)
{
- filename = csp->clist->filename;
- file_description = "Cookie List";
+ filename = csp->permissions_list->filename;
+ file_description = "Permissions List";
}
break;
case 'f':
break;
#endif /* def USE_IMAGE_LIST */
-#ifdef KILLPOPUPS
- case 'p':
- if (csp->plist)
- {
- filename = csp->plist->filename;
- file_description = "Popup list";
- }
- break;
-#endif /* def KILLPOPUPS */
-
#ifdef PCRS
case 'r':
if (csp->rlist)
s = strsav(s, "</code></a></li>\n");
}
- if (csp->clist)
+ if (csp->permissions_list)
{
- s = strsav(s, "<li>Cookie List: <a href=\"show-proxy-args?cookie\"><code>");
- s = strsav(s, csp->clist->filename);
+ s = strsav(s, "<li>Permissions List: <a href=\"show-proxy-args?permit\"><code>");
+ s = strsav(s, csp->permissions_list->filename);
s = strsav(s, "</code></a></li>\n");
}
s = strsav(s, "</code></a></li>\n");
}
#endif /* def USE_IMAGE_LIST */
-
-#ifdef KILLPOPUPS
- if (csp->plist)
- {
- s = strsav(s, "<li>Popup List: <a href=\"show-proxy-args?popup\"><code>");
- s = strsav(s, csp->plist->filename);
- s = strsav(s, "</code></a></li>\n");
- }
-#endif /* def KILLPOPUPS */
-
+\r
#ifdef PCRS
if (csp->rlist)
{
}
#endif /* def USE_IMAGE_LIST */
-#ifdef KILLPOPUPS
- if (csp->plist)
- {
- s = strsav(s, csp->plist->proxy_args);
- }
-#endif /* def KILLPOPUPS */
-
#ifdef PCRS
if (csp->rlist)
{