]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
config: follow up to r1809302.
authorYann Ylavic <ylavic@apache.org>
Fri, 22 Sep 2017 12:31:54 +0000 (12:31 +0000)
committerYann Ylavic <ylavic@apache.org>
Fri, 22 Sep 2017 12:31:54 +0000 (12:31 +0000)
We need to check that the module itself is at the right version.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809305 13f79535-47bb-0310-9956-ffa450edef68

include/http_config.h
server/config.c

index 9adfcbf9a7326627513131104fa8ca2cb7c94aaa..cfc0c3233cd32a6d6edb7c0779f17b7de42e3ab6 100644 (file)
@@ -333,8 +333,11 @@ struct cmd_parms_struct {
     ap_directive_t *parent;
 };
 
-#define AP_MODULE_HAS_FLAGS \
-        AP_MODULE_MAGIC_AT_LEAST(20161018,7)
+#define AP_MODULE_FLAGS_MMN_MAJOR 20161018
+#define AP_MODULE_FLAGS_MMN_MINOR 7
+#define AP_MODULE_HAS_FLAGS(m) \
+        AP_MODULE_MAGIC_AT_LEAST(AP_MODULE_FLAGS_MMN_MAJOR, \
+                                 AP_MODULE_FLAGS_MMN_MINOR)
 #if AP_MODULE_HAS_FLAGS
 /**
  * Flags associated with a module.
index 74674a52fcc232a7fda06edcefcebf4177402e14..12552c6474be0554ae4c1c1d0ee8be9ab3ef2845 100644 (file)
@@ -339,8 +339,14 @@ static void merge_server_configs(apr_pool_t *p, ap_conf_vector_t *base,
 
         if (!virt_vector[i]) {
 #if AP_MODULE_HAS_FLAGS
-            if (df && modp->create_server_config
-                   && modp->flags & AP_MODULE_FLAG_ALWAYS_MERGE) {
+            if (df
+                    && modp->create_server_config
+                    && (modp->version > AP_MODULE_FLAGS_MMN_MAJOR
+                        || (modp->version == AP_MODULE_FLAGS_MMN_MAJOR
+                            && (modp->minor_version >=
+                                AP_MODULE_FLAGS_MMN_MINOR)))
+                    /* keep this after version checks (flags out-of-bound) */
+                    && (modp->flags & AP_MODULE_FLAG_ALWAYS_MERGE)) {
                 virt_vector[i] = (*modp->create_server_config)(p, virt);
             }
             else