Addressed bug #719435
authoroes <oes@users.sourceforge.net>
Fri, 11 Apr 2003 12:06:14 +0000 (12:06 +0000)
committeroes <oes@users.sourceforge.net>
Fri, 11 Apr 2003 12:06:14 +0000 (12:06 +0000)
 - Extraneous filterfile directives now logged as errors
 - This and unrecnonised directives now really obvious on status page

loadcfg.c

index 48d1a25..854a391 100644 (file)
--- a/loadcfg.c
+++ b/loadcfg.c
@@ -1,4 +1,4 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.48.2.2 2002/11/12 16:28:20 oes Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.48.2.3 2003/03/11 11:53:59 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/Attic/loadcfg.c,v $
@@ -35,6 +35,9 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.48.2.2 2002/11/12 16:28:20 oes Ex
  *
  * Revisions   :
  *    $Log: loadcfg.c,v $
+ *    Revision 1.48.2.3  2003/03/11 11:53:59  oes
+ *    Cosmetic: Renamed cryptic variable
+ *
  *    Revision 1.48.2.2  2002/11/12 16:28:20  oes
  *    Move unrelated variable declaration out of #ifdef FEATURE_ACL; fixes bug #636655
  *
@@ -838,6 +841,22 @@ struct configuration_spec * load_config(void)
             continue;
 #endif /* def FEATURE_CGI_EDIT_ACTIONS */
 
+/* *************************************************************************
+ * filterfile file-name
+ * In confdir by default.
+ * *************************************************************************/
+         case hash_filterfile :
+            if(config->re_filterfile)
+            {
+               log_error(LOG_LEVEL_ERROR, "Ignoring extraneous directive 'filterfile %s' "
+                  "in line %lu in configuration file (%s).", arg, linenum, configfile);
+               string_append(&config->proxy_args, 
+                  " <b><font color=\"red\">WARNING: extraneous directive, ignored</font></b>");
+               continue;
+            }
+            config->re_filterfile = make_path(config->confdir, arg);
+            continue;
+
 /* *************************************************************************
  * forward url-pattern (.|http-proxy-host[:port])
  * *************************************************************************/
@@ -1181,15 +1200,6 @@ struct configuration_spec * load_config(void)
             config->proxy_info_url = strdup(arg);
             continue;
 
-/* *************************************************************************
- * re_filterfile file-name
- * In confdir by default.
- * *************************************************************************/
-         case hash_filterfile :
-            freez(config->re_filterfile);
-            config->re_filterfile = make_path(config->confdir, arg);
-            continue;
-
 /* *************************************************************************
  * single-threaded
  * *************************************************************************/
@@ -1370,11 +1380,10 @@ struct configuration_spec * load_config(void)
              * error.  To change back to an error, just change log level
              * to LOG_LEVEL_FATAL.
              */
-            log_error(LOG_LEVEL_ERROR, "Unrecognized directive '%s' (%luul) in line %lu in "
-                  "configuration file (%s).",  buf, hash_string(cmd), linenum, configfile);
-            string_append(&config->proxy_args, "<br>\nWARNING: unrecognized directive : ");
-            string_append(&config->proxy_args, buf);
-            string_append(&config->proxy_args, "<br><br>\n");
+            log_error(LOG_LEVEL_ERROR, "Ignoring unrecognized directive '%s' (%luul) in line %lu "
+                  "in configuration file (%s).",  buf, hash_string(cmd), linenum, configfile);
+            string_append(&config->proxy_args,
+               " <b><font color=\"red\">WARNING: unrecognized directive, ignored</font></b>");
             continue;
 
 /* *************************************************************************/
@@ -1555,7 +1564,7 @@ static void savearg(char *command, char *argument, struct configuration_spec * c
     * Add config option name embedded in
     * link to it's section in the user-manual
     */
-   buf = strdup("<a href=\"");
+   buf = strdup("\n<br><a href=\"");
    string_append(&buf, config->usermanual);
    string_append(&buf, CONFIG_HELP_PREFIX);
    string_join  (&buf, string_toupper(command));
@@ -1593,8 +1602,6 @@ static void savearg(char *command, char *argument, struct configuration_spec * c
       }
    }
 
-   string_append(&buf, "<br>\n");
-
    string_join(&config->proxy_args, buf);
 }