]> granicus.if.org Git - apache/commitdiff
* mod_md: fix compiler warnings
authorStefan Eissing <icing@apache.org>
Mon, 5 Aug 2019 10:27:34 +0000 (10:27 +0000)
committerStefan Eissing <icing@apache.org>
Mon, 5 Aug 2019 10:27:34 +0000 (10:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864425 13f79535-47bb-0310-9956-ffa450edef68

modules/md/md_acme_acct.c
modules/md/md_acme_order.c
modules/md/md_crypt.c
modules/md/md_time.c
modules/md/md_version.h
modules/md/mod_md.c
modules/md/mod_md_config.c
modules/md/mod_md_drive.c

index 0f55ab258f4417d03a482c3f1a96c638ffe38b16..e1e36dfff8e7679bd1fb99341b1c38782b1abe48 100644 (file)
@@ -443,7 +443,7 @@ static apr_status_t acct_upd(md_acme_t *acme, apr_pool_t *p,
     }
     
     apr_array_clear(acct->contacts);
-    md_json_getsa(acct->contacts, body, MD_KEY_CONTACT, NULL);
+    md_json_dupsa(acct->contacts, acme->p, body, MD_KEY_CONTACT, NULL);
     if (md_json_has_key(body, MD_KEY_STATUS, NULL)) {
         acct->status = acct_st_from_str(md_json_gets(body, MD_KEY_STATUS, NULL));
     }
index 51956e97c0f0a9b49c49c16322e3d5fcaee001b5..9314f2067807e9f5f8c3f2f7784cab73a8ed77fb 100644 (file)
@@ -505,7 +505,7 @@ static apr_status_t check_challenges(void *baton, int attempt)
                 default:
                     rv = APR_EINVAL;
                     md_result_printf(ctx->result, rv, 
-                                     "domain authorization for %s failed with state %s", 
+                                     "domain authorization for %s failed with state %d", 
                                      authz->domain, authz->state);
                     md_result_log(ctx->result, MD_LOG_ERR);
                     goto leave;
index c9f73614cd5d3bef60cebdbb8d41c9a278dec81b..57c32a2bfbc728a1fa90d0cb8acdbd0374d457c8 100644 (file)
@@ -1545,6 +1545,9 @@ apr_status_t md_cert_get_ct_scts(apr_array_header_t *scts, apr_pool_t *p, const
     md_log_perror(MD_LOG_MARK, MD_LOG_TRACE3, 0, p, "ct_sct, found %d SCT extensions", scts->nelts);
     return APR_SUCCESS;
 #else
+    (void)scts;
+    (void)p;
+    (void)cert;
     return APR_ENOTIMPL;
 #endif
 }
index f99b8865d8728d4559828e5242dad63d1e66ace1..4f494b3eff6b67148aa0e7d3de48031bbe090d66 100644 (file)
@@ -219,7 +219,7 @@ const char *md_timeslice_parse(const md_timeslice_t **pts, apr_pool_t *p,
                                const char *val, apr_interval_time_t norm)
 {
     md_timeslice_t *ts;
-    int percent;
+    int percent = 0;
 
     *pts = NULL;
     if (!val) {
index 21286a261610099cdc2dfe0b9a77b031d05bce4a..d7ebed23b66ad27c17d869a094b91447747582fc 100644 (file)
@@ -27,7 +27,7 @@
  * @macro
  * Version number of the md module as c string
  */
-#define MOD_MD_VERSION "2.0.7"
+#define MOD_MD_VERSION "2.0.10"
 
 /**
  * @macro
@@ -35,7 +35,7 @@
  * release. This is a 24 bit number with 8 bits for major number, 8 bits
  * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
  */
-#define MOD_MD_VERSION_NUM 0x020007
+#define MOD_MD_VERSION_NUM 0x02000a
 
 #define MD_ACME_DEF_URL    "https://acme-v02.api.letsencrypt.org/directory"
 
index 23ad12ee2fe5cb8fc1ab17dc275b05744c5b5d12..154a08ef11c8e7af60fe4fd25de2c10fe1d4327c 100644 (file)
@@ -143,8 +143,8 @@ static apr_status_t store_file_ev(void *baton, struct md_store_t *store,
     ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s, "store event=%d on %s %s (group %d)", 
                  ev, (ftype == APR_DIR)? "dir" : "file", fname, group);
                  
-    /* Directories in group CHALLENGES and STAGING are written to under a different user. 
-     * Give him ownership. 
+    /* Directories in group CHALLENGES, STAGING and OCSP are written to 
+     * under a different user. Give her ownership. 
      */
     if (ftype == APR_DIR) {
         switch (group) {
@@ -191,7 +191,8 @@ static apr_status_t setup_store(md_store_t **pstore, md_mod_conf_t *mc,
     md_store_fs_set_event_cb(*pstore, store_file_ev, s);
     if (APR_SUCCESS != (rv = check_group_dir(*pstore, MD_SG_CHALLENGES, p, s))
         || APR_SUCCESS != (rv = check_group_dir(*pstore, MD_SG_STAGING, p, s))
-        || APR_SUCCESS != (rv = check_group_dir(*pstore, MD_SG_ACCOUNTS, p, s))) {
+        || APR_SUCCESS != (rv = check_group_dir(*pstore, MD_SG_ACCOUNTS, p, s))
+        ) {
         ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(10047) 
                      "setup challenges directory");
     }
@@ -707,8 +708,8 @@ static void init_watched_names(md_mod_conf_t *mc, apr_pool_t *p, apr_pool_t *pte
     }
 }   
 
-static apr_status_t md_post_config(apr_pool_t *p, apr_pool_t *plog,
-                                   apr_pool_t *ptemp, server_rec *s)
+static apr_status_t md_post_config_before_ssl(apr_pool_t *p, apr_pool_t *plog,
+                                              apr_pool_t *ptemp, server_rec *s)
 {
     void *data = NULL;
     const char *mod_md_init_key = "mod_md_init_counter";
@@ -751,11 +752,10 @@ static apr_status_t md_post_config(apr_pool_t *p, apr_pool_t *plog,
 
     if (APR_SUCCESS != (rv = setup_store(&store, mc, p, s))
         || APR_SUCCESS != (rv = md_reg_create(&mc->reg, p, store, mc->proxy_url))) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(10072)
-                     "setup md registry");
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(10072) "setup md registry");
         goto leave;
     }
-    
+
     init_ssl();
 
     /* How to bootstrap this module:
@@ -939,17 +939,8 @@ static apr_status_t get_certificate(server_rec *s, apr_pool_t *p, int fallback,
     }
     
     if (!sc->assigned) {
-        /* Hmm, mod_ssl (or someone like it) asks for certificates for a server
-         * where we did not assign a MD to. Either the user forgot to configure
-         * that server with SSL certs, has misspelled a server name or we have
-         * a bug that prevented us from taking responsibility for this server.
-         * Either way, make some polite noise */
-        ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s, APLOGNO(10114)  
-                     "asked for certificate of server %s which has no MD assigned. This "
-                     "could be ok, but most likely it is either a misconfiguration or "
-                     "a bug. Please check server names and MD names carefully and if "
-                     "everything checks open, please open an issue.", 
-                     s->server_hostname);
+        /* With the new hooks in mod_ssl, we are invoked for all server_rec. It is
+         * therefore normal, when we have nothing to add here. */
         return APR_ENOENT;
     }
     
@@ -1254,8 +1245,9 @@ static void md_hooks(apr_pool_t *pool)
     ap_log_perror(APLOG_MARK, APLOG_TRACE1, 0, pool, "installing hooks");
     
     /* Run once after configuration is set, before mod_ssl.
+     * Run again after mod_ssl is done.
      */
-    ap_hook_post_config(md_post_config, NULL, mod_ssl, APR_HOOK_MIDDLE);
+    ap_hook_post_config(md_post_config_before_ssl, NULL, mod_ssl, APR_HOOK_MIDDLE);
     
     /* Run once after a child process has been created.
      */
index 9123a22d326bb070593695f79d53b18394984b76..ffb09470db92ff34d7784760fe0270589550453c 100644 (file)
@@ -45,7 +45,7 @@
 static md_mod_conf_t defmc = {
     NULL,                      /* list of mds */
 #if AP_MODULE_MAGIC_AT_LEAST(20180906, 2)
-    NULL,                      /* base dirm by default state-dir-relative */
+    NULL,                      /* base dir by default state-dir-relative */
 #else
     MD_DEFAULT_BASE_DIR,
 #endif
@@ -897,7 +897,7 @@ 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 AP_MODULE_MAGIC_AT_LEAST(20180906, 2)
     if (mc->base_dir == NULL) {
         mc->base_dir = ap_state_dir_relative(p, MD_DEFAULT_BASE_DIR);
index 670c7e79102887f56600febe0d3e3d077cb16e12..31fdc272251b0362b2dc243b2836c661d87d6f9a 100644 (file)
@@ -149,7 +149,7 @@ static apr_status_t send_notification(md_drive_ctx *dctx, md_job_t *job, const m
     const char * const *argv;
     const char *cmdline;
     int exit_code;
-    apr_status_t rv;            
+    apr_status_t rv = APR_SUCCESS;            
     
     if (!strcmp("renewed", reason)) {
         if (dctx->mc->notify_cmd) {