Divide @filter-params@ into @client-header-filter-params@
[privoxy.git] / loadcfg.c
index 160ff0d..7593f0f 100644 (file)
--- a/loadcfg.c
+++ b/loadcfg.c
@@ -1,4 +1,4 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.59 2006/12/31 17:56:38 fabiankeil Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.61 2007/03/16 16:47:35 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@ -35,6 +35,14 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.59 2006/12/31 17:56:38 fabiankeil
  *
  * Revisions   :
  *    $Log: loadcfg.c,v $
+ *    Revision 1.61  2007/03/16 16:47:35  fabiankeil
+ *    - Mention other reasons why acl directive loading might have failed.
+ *    - Don't log the acl source if the acl destination is to blame.
+ *
+ *    Revision 1.60  2007/01/27 13:09:16  fabiankeil
+ *    Add new config option "templdir" to
+ *    change the templates directory.
+ *
  *    Revision 1.59  2006/12/31 17:56:38  fabiankeil
  *    Added config option accept-intercepted-requests
  *    and disabled it by default.
@@ -482,6 +490,7 @@ static struct file_list *current_configfile = NULL;
 #define hash_enable_edit_actions         2517097536ul /* "enable-edit-actions" */
 #define hash_enable_remote_toggle        2979744683ul /* "enable-remote-toggle" */
 #define hash_enable_remote_http_toggle    110543988ul /* "enable-remote-http-toggle" */
+#define hash_enforce_blocks              1862427469ul /* "enforce-blocks" */
 #define hash_filterfile                   250887266ul /* "filterfile" */
 #define hash_forward                        2029845ul /* "forward" */
 #define hash_forward_socks4              3963965521ul /* "forward-socks4" */
@@ -863,11 +872,11 @@ struct configuration_spec * load_config(void)
 
             if (acl_addr(vec[0], cur_acl->src) < 0)
             {
-               log_error(LOG_LEVEL_ERROR, "Invalid source IP for deny-access "
-                     "directive in configuration file: \"%s\"", vec[0]);
+               log_error(LOG_LEVEL_ERROR, "Invalid source address, port or netmask "
+                  "for deny-access directive in configuration file: \"%s\"", vec[0]);
                string_append(&config->proxy_args,
-                  "<br>\nWARNING: Invalid source IP for deny-access directive"
-                  " in configuration file: \"");
+                  "<br>\nWARNING: Invalid source address, port or netmask "
+                  "for deny-access directive in configuration file: \"");
                string_append(&config->proxy_args,
                   vec[0]);
                string_append(&config->proxy_args,
@@ -879,13 +888,13 @@ struct configuration_spec * load_config(void)
             {
                if (acl_addr(vec[1], cur_acl->dst) < 0)
                {
-                  log_error(LOG_LEVEL_ERROR, "Invalid destination IP for deny-access "
-                        "directive in configuration file: \"%s\"", vec[0]);
+                  log_error(LOG_LEVEL_ERROR, "Invalid destination address, port or netmask "
+                     "for deny-access directive in configuration file: \"%s\"", vec[1]);
                   string_append(&config->proxy_args,
-                     "<br>\nWARNING: Invalid destination IP for deny-access directive"
-                     " in configuration file: \"");
+                     "<br>\nWARNING: Invalid destination address, port or netmask "
+                     "for deny-access directive in configuration file: \"");
                   string_append(&config->proxy_args,
-                     vec[0]);
+                     vec[1]);
                   string_append(&config->proxy_args,
                      "\"<br><br>\n");
                   freez(cur_acl);
@@ -954,6 +963,22 @@ struct configuration_spec * load_config(void)
             }
             continue;
 
+/* *************************************************************************
+ * hash_enforce_blocks 0|1
+ * *************************************************************************/
+#ifdef FEATURE_FORCE_LOAD
+         case hash_enforce_blocks:
+            if ((*arg != '\0') && (0 != atoi(arg)))
+            {
+               config->feature_flags |= RUNTIME_FEATURE_ENFORCE_BLOCKS;
+            }
+            else
+            {
+               config->feature_flags &= ~RUNTIME_FEATURE_ENFORCE_BLOCKS;
+            }
+            continue;
+#endif /* def FEATURE_FORCE_LOAD */
+
 /* *************************************************************************
  * filterfile file-name
  * In confdir by default.
@@ -1278,11 +1303,11 @@ struct configuration_spec * load_config(void)
 
             if (acl_addr(vec[0], cur_acl->src) < 0)
             {
-               log_error(LOG_LEVEL_ERROR, "Invalid source IP for permit-access "
-                     "directive in configuration file: \"%s\"", vec[0]);
+               log_error(LOG_LEVEL_ERROR, "Invalid source address, port or netmask "
+                  "for permit-access directive in configuration file: \"%s\"", vec[0]);
                string_append(&config->proxy_args,
-                  "<br>\nWARNING: Invalid source IP for permit-access directive"
-                  " in configuration file: \"");
+                  "<br>\nWARNING: Invalid source address, port or netmask for "
+                  "permit-access directive in configuration file: \"");
                string_append(&config->proxy_args,
                   vec[0]);
                string_append(&config->proxy_args,
@@ -1294,14 +1319,13 @@ struct configuration_spec * load_config(void)
             {
                if (acl_addr(vec[1], cur_acl->dst) < 0)
                {
-                  log_error(LOG_LEVEL_ERROR, "Invalid destination IP for "
-                        "permit-access directive in configuration file: \"%s\"",
-                        vec[0]);
+                  log_error(LOG_LEVEL_ERROR, "Invalid destination address, port or netmask "
+                     "for permit-access directive in configuration file: \"%s\"", vec[1]);
                   string_append(&config->proxy_args,
-                     "<br>\nWARNING: Invalid destination IP for permit-access directive"
-                     " in configuration file: \"");
+                     "<br>\nWARNING: Invalid destination address, port or netmask for "
+                     "permit-access directive in configuration file: \"");
                   string_append(&config->proxy_args,
-                     vec[0]);
+                     vec[1]);
                   string_append(&config->proxy_args,
                      "\"<br><br>\n");
                   freez(cur_acl);