diff options
author | Stefan Eissing <icing@apache.org> | 2017-08-09 15:43:26 +0200 |
---|---|---|
committer | Stefan Eissing <icing@apache.org> | 2017-08-09 15:43:26 +0200 |
commit | 13ee3b3ecfb9657589b05ac07e37fb5f7422fad4 (patch) | |
tree | cc09dc512c8b2951b2a56417d635865b7b1bf419 /modules/md/md_reg.c | |
parent | mod_md: v0.6.0 from github (diff) | |
download | apache2-13ee3b3ecfb9657589b05ac07e37fb5f7422fad4.tar.xz apache2-13ee3b3ecfb9657589b05ac07e37fb5f7422fad4.zip |
mod_md: v0.6.1 from github
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/trunk-md@1804529 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/md/md_reg.c')
-rw-r--r-- | modules/md/md_reg.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/modules/md/md_reg.c b/modules/md/md_reg.c index b2953fb909..791565fd7d 100644 --- a/modules/md/md_reg.c +++ b/modules/md/md_reg.c @@ -357,7 +357,7 @@ static int find_domain(void *baton, md_reg_t *reg, md_t *md) { find_domain_ctx *ctx = baton; - if (md_contains(md, ctx->domain)) { + if (md_contains(md, ctx->domain, 0)) { ctx->md = md; return 0; } @@ -685,7 +685,7 @@ apr_status_t md_reg_sync(md_reg_t *reg, apr_pool_t *p, apr_pool_t *ptemp, md_log_perror(MD_LOG_MARK, MD_LOG_DEBUG, rv, p, "sync: found %d mds in store", ctx.store_mds->nelts); if (APR_SUCCESS == rv) { - int i, added, fields; + int i, fields; md_t *md, *config_md, *smd, *omd; const char *common; @@ -696,11 +696,18 @@ apr_status_t md_reg_sync(md_reg_t *reg, apr_pool_t *p, apr_pool_t *ptemp, smd = md_find_closest_match(ctx.store_mds, md); if (smd) { fields = 0; - /* add any newly configured domains to the store md */ - added = md_array_str_add_missing(smd->domains, md->domains, 0); - if (added) { + + /* Once stored, we keep the name */ + if (strcmp(md->name, smd->name)) { + md->name = apr_pstrdup(p, smd->name); + } + + /* Make the stored domain list *exactly* the same, even if + * someone only changed upper/lowercase, we'd like to persist that. */ + if (!md_equal_domains(md, smd, 1)) { md_log_perror(MD_LOG_MARK, MD_LOG_DEBUG, rv, p, - "%s: %d domains added", smd->name, added); + "%s: %d domains changed", smd->name); + smd->domains = md_array_str_clone(ptemp, md->domains); fields |= MD_UPD_DOMAINS; } @@ -712,7 +719,7 @@ apr_status_t md_reg_sync(md_reg_t *reg, apr_pool_t *p, apr_pool_t *ptemp, /* Is this md still configured or has it been abandoned in the config? */ config_md = md_get_by_name(ctx.conf_mds, omd->name); - if (config_md && md_contains(config_md, common)) { + if (config_md && md_contains(config_md, common, 0)) { /* domain used in two configured mds, not allowed */ rv = APR_EINVAL; md_log_perror(MD_LOG_MARK, MD_LOG_ERR, rv, p, |