+ case hash_permit_access:
+ vec_count = ssplit(arg, " \t", vec, SZ(vec), 1, 1);
+
+ if ((vec_count != 1) && (vec_count != 2))
+ {
+ log_error(LOG_LEVEL_ERROR, "Wrong number of parameters for "
+ "permit-access directive in configuration file.");
+ config->proxy_args_invocation = strsav( config->proxy_args_invocation,
+ "<br>\nWARNING: Wrong number of parameters for "
+ "permit-access directive in configuration file.<br><br>\n");
+
+ continue;
+ }
+
+ /* allocate a new node */
+ cur_acl = (struct access_control_list *) zalloc(sizeof(*cur_acl));
+
+ if (cur_acl == NULL)
+ {
+ log_error(LOG_LEVEL_FATAL, "can't allocate memory for configuration");
+ /* Never get here - LOG_LEVEL_FATAL causes program exit */
+ continue;
+ }
+ cur_acl->action = ACL_PERMIT;
+
+ 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]);
+ config->proxy_args_invocation = strsav( config->proxy_args_invocation,
+ "<br>\nWARNING: Invalid source IP for permit-access directive"
+ " in configuration file: \"");
+ config->proxy_args_invocation = strsav( config->proxy_args_invocation,
+ vec[0]);
+ config->proxy_args_invocation = strsav( config->proxy_args_invocation,
+ "\"<br><br>\n");
+ freez(cur_acl);
+ continue;
+ }
+ if (vec_count == 2)
+ {
+ 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]);
+ config->proxy_args_invocation = strsav( config->proxy_args_invocation,
+ "<br>\nWARNING: Invalid destination IP for permit-access directive"
+ " in configuration file: \"");
+ config->proxy_args_invocation = strsav( config->proxy_args_invocation,
+ vec[0]);
+ config->proxy_args_invocation = strsav( config->proxy_args_invocation,
+ "\"<br><br>\n");
+ freez(cur_acl);
+ continue;
+ }
+ }
+
+ /*
+ * Add it to the list. Note we reverse the list to get the
+ * behaviour the user expects. With both the ACL and
+ * actions file, the last match wins. However, the internal
+ * implementations are different: The actions file is stored
+ * in the same order as the file, and scanned completely.
+ * With the ACL, we reverse the order as we load it, then
+ * when we scan it we stop as soon as we get a match.
+ */
+ cur_acl->next = config->acl;
+ config->acl = cur_acl;
+