If the enforce-blocks directive is used with FEATURE_FORCE_LOAD
authorFabian Keil <fk@fabiankeil.de>
Sat, 2 Aug 2008 08:23:22 +0000 (08:23 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sat, 2 Aug 2008 08:23:22 +0000 (08:23 +0000)
disabled, log a message that blocks will always be enforced
instead of complaining about an unrecognized directive.
Reported by Pietro Leone.

loadcfg.c

index 904110a..59a3890 100644 (file)
--- a/loadcfg.c
+++ b/loadcfg.c
@@ -1,4 +1,4 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.76 2008/05/10 09:03:16 fabiankeil Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.77 2008/05/26 16:13:22 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@ -35,6 +35,9 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.76 2008/05/10 09:03:16 fabiankeil
  *
  * Revisions   :
  *    $Log: loadcfg.c,v $
+ *    Revision 1.77  2008/05/26 16:13:22  fabiankeil
+ *    Reuse directive_hash and don't hash the same directive twice.
+ *
  *    Revision 1.76  2008/05/10 09:03:16  fabiankeil
  *    - Merge three string_append() calls.
  *    - Remove useless assertion.
@@ -1039,10 +1042,10 @@ struct configuration_spec * load_config(void)
             continue;
 
 /* *************************************************************************
- * hash_enforce_blocks 0|1
+ * enforce-blocks 0|1
  * *************************************************************************/
-#ifdef FEATURE_FORCE_LOAD
          case hash_enforce_blocks:
+#ifdef FEATURE_FORCE_LOAD
             if ((*arg != '\0') && (0 != atoi(arg)))
             {
                config->feature_flags |= RUNTIME_FEATURE_ENFORCE_BLOCKS;
@@ -1051,8 +1054,11 @@ struct configuration_spec * load_config(void)
             {
                config->feature_flags &= ~RUNTIME_FEATURE_ENFORCE_BLOCKS;
             }
-            continue;
+#else
+            log_error(LOG_LEVEL_ERROR, "Ignoring directive 'enforce-blocks'. "
+               "FEATURE_FORCE_LOAD is disabled, blocks will always be enforced.");
 #endif /* def FEATURE_FORCE_LOAD */
+            continue;
 
 /* *************************************************************************
  * filterfile file-name