You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2018/06/05 12:43:08 UTC

svn commit: r1832935 - in /httpd/httpd/trunk: docs/manual/mod/mod_md.xml modules/md/md_version.h modules/md/mod_md.c modules/md/mod_md_config.c

Author: icing
Date: Tue Jun  5 12:43:08 2018
New Revision: 1832935

URL: http://svn.apache.org/viewvc?rev=1832935&view=rev
Log:
 * integrating latest changes from microgrit
 * MDNotifyCmd can now specify arguments to the command

Modified:
    httpd/httpd/trunk/docs/manual/mod/mod_md.xml
    httpd/httpd/trunk/modules/md/md_version.h
    httpd/httpd/trunk/modules/md/mod_md.c
    httpd/httpd/trunk/modules/md/mod_md_config.c

Modified: httpd/httpd/trunk/docs/manual/mod/mod_md.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_md.xml?rev=1832935&r1=1832934&r2=1832935&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_md.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_md.xml Tue Jun  5 12:43:08 2018
@@ -391,15 +391,15 @@ MDCertificateAgreement https://letsencry
     <directivesynopsis>
         <name>MDNotifyCmd</name>
         <description>Run a program when Managed Domain are ready.</description>
-        <syntax>MDNotifyCmd <var>path</var></syntax>
+        <syntax>MDNotifyCmd <var>path</var> [ <var>args</var> ]</syntax>
         <contextlist>
             <context>server config</context>
         </contextlist>
         <usage>
             <p>The configured executable is run when Managed Domains have signed up or
             renewed their certificates. It is given the names of the processed MDs as
-            arguments. It should return status code 0 to indicate that it has 
-            run successfully.
+            additional arguments (after the parameters specified here). It should 
+            return status code 0 to indicate that it has run successfully.
             </p>
         </usage>
     </directivesynopsis>

Modified: httpd/httpd/trunk/modules/md/md_version.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/md/md_version.h?rev=1832935&r1=1832934&r2=1832935&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/md/md_version.h (original)
+++ httpd/httpd/trunk/modules/md/md_version.h Tue Jun  5 12:43:08 2018
@@ -27,7 +27,7 @@
  * @macro
  * Version number of the md module as c string
  */
-#define MOD_MD_VERSION "1.1.10"
+#define MOD_MD_VERSION "1.1.12"
 
 /**
  * @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 0x01010a
+#define MOD_MD_VERSION_NUM 0x01010c
 
 #define MD_ACME_DEF_URL    "https://acme-v01.api.letsencrypt.org/directory"
 

Modified: httpd/httpd/trunk/modules/md/mod_md.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/md/mod_md.c?rev=1832935&r1=1832934&r2=1832935&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/md/mod_md.c (original)
+++ httpd/httpd/trunk/modules/md/mod_md.c Tue Jun  5 12:43:08 2018
@@ -823,8 +823,12 @@ static apr_status_t run_watchdog(int sta
                                  wd->mc->notify_cmd, exit_code);
                 }
                 else {
+                    if (APR_EINCOMPLETE == rv && exit_code) {
+                        rv = 0;
+                    }
                     ap_log_error(APLOG_MARK, APLOG_ERR, rv, wd->s, APLOGNO(10109) 
-                                 "executing configured MDNotifyCmd %s", wd->mc->notify_cmd);
+                                 "executing MDNotifyCmd %s returned %d", 
+                                  wd->mc->notify_cmd, exit_code);
                     notified = 0;
                 } 
             }
@@ -1305,7 +1309,8 @@ static int md_http_challenge_pr(request_
     int configured;
     apr_status_t rv;
     
-    if (!strncmp(ACME_CHALLENGE_PREFIX, r->parsed_uri.path, sizeof(ACME_CHALLENGE_PREFIX)-1)) {
+    if (r->parsed_uri.path 
+        && !strncmp(ACME_CHALLENGE_PREFIX, r->parsed_uri.path, sizeof(ACME_CHALLENGE_PREFIX)-1)) {
         sc = ap_get_module_config(r->server->module_config, &md_module);
         if (sc && sc->mc) {
             configured = (NULL != md_get_by_domain(sc->mc->mds, r->hostname));
@@ -1371,7 +1376,7 @@ static int md_require_https_maybe(reques
     const char *s;
     int status;
     
-    if (opt_ssl_is_https 
+    if (opt_ssl_is_https && r->parsed_uri.path
         && strncmp(WELL_KNOWN_PREFIX, r->parsed_uri.path, sizeof(WELL_KNOWN_PREFIX)-1)) {
         
         sc = ap_get_module_config(r->server->module_config, &md_module);

Modified: httpd/httpd/trunk/modules/md/mod_md_config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/md/mod_md_config.c?rev=1832935&r1=1832934&r2=1832935&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/md/mod_md_config.c (original)
+++ httpd/httpd/trunk/modules/md/mod_md_config.c Tue Jun  5 12:43:08 2018
@@ -771,7 +771,7 @@ static const char *md_config_set_pkeys(c
     return apr_pstrcat(cmd->pool, "unsupported private key type \"", ptype, "\"", NULL);
 }
 
-static const char *md_config_set_notify_cmd(cmd_parms *cmd, void *arg, const char *value)
+static const char *md_config_set_notify_cmd(cmd_parms *cmd, void *mconfig, const char *arg)
 {
     md_srv_conf_t *sc = md_config_get(cmd->server);
     const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
@@ -779,8 +779,8 @@ static const char *md_config_set_notify_
     if (err) {
         return err;
     }
-    sc->mc->notify_cmd = value;
-    (void)arg;
+    sc->mc->notify_cmd = arg;
+    (void)mconfig;
     return NULL;
 }
 
@@ -837,8 +837,8 @@ const command_rec md_cmds[] = {
                   "Time length for renewal before certificate expires (defaults to days)"),
     AP_INIT_TAKE1(     MD_CMD_REQUIREHTTPS, md_config_set_require_https, NULL, RSRC_CONF, 
                   "Redirect non-secure requests to the https: equivalent."),
-    AP_INIT_TAKE1(     MD_CMD_NOTIFYCMD, md_config_set_notify_cmd, NULL, RSRC_CONF, 
-                  "set the command to run when signup/renew of domain is complete."),
+    AP_INIT_RAW_ARGS(MD_CMD_NOTIFYCMD, md_config_set_notify_cmd, NULL, RSRC_CONF, 
+                  "set the command and optional arguments to run when signup/renew of domain is complete."),
     AP_INIT_TAKE1(     MD_CMD_BASE_SERVER, md_config_set_base_server, NULL, RSRC_CONF, 
                   "allow managing of base server outside virtual hosts."),