mod_md/mod_md-2.0.3-state_dir.patch
2019-06-13 17:41:24 +02:00

43 lines
1.4 KiB
Diff

From 67cb21cae6ce9b1d76479f2fff14fe5ea106f994 Mon Sep 17 00:00:00 2001
From: Joe Orton <jorton@redhat.com>
Date: Tue, 11 Jun 2019 15:17:59 +0100
Subject: [PATCH] Fix use of StateDir after httpd trunk r1852982:
* src/mod_md_config.c (md_config_post_config): Pick up base_dir
from statedir in post-config phase so StateDir can influence it.
(Sync with httpd r1857731)
---
src/mod_md_config.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/mod_md_config.c b/src/mod_md_config.c
index f9dd128..8a9330f 100644
--- a/src/mod_md_config.c
+++ b/src/mod_md_config.c
@@ -131,11 +131,6 @@ static md_mod_conf_t *md_mod_conf_get(apr_pool_t *pool, int create)
mod_md_config->env = apr_table_make(pool, 10);
mod_md_config->init_errors = apr_hash_make(pool);
-#if AP_MODULE_MAGIC_AT_LEAST(20180906, 2)
- mod_md_config->base_dir = ap_state_dir_relative(pool,
- MD_DEFAULT_BASE_DIR);
-#endif
-
apr_pool_cleanup_register(pool, NULL, cleanup_mod_config, apr_pool_cleanup_null);
}
@@ -853,6 +848,12 @@ apr_status_t md_config_post_config(server_rec *s, apr_pool_t *p)
if (mc->hsts_max_age > 0) {
mc->hsts_header = apr_psprintf(p, "max-age=%d", mc->hsts_max_age);
}
+
+#if 1
+ if (mc->base_dir == NULL) {
+ mc->base_dir = ap_state_dir_relative(p, MD_DEFAULT_BASE_DIR);
+ }
+#endif
return APR_SUCCESS;
}