Skip to content

mod_md: minor refactoring - #768

Open
notroj wants to merge 6 commits into
apache:trunkfrom
notroj:md-refactoring
Open

notroj wants to merge 6 commits into
apache:trunkfrom
notroj:md-refactoring

Conversation

@notroj

@notroj notroj commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@notroj
notroj force-pushed the md-refactoring branch 2 times, most recently from e67d1e0 to 0237e68 Compare September 22, 2026 18:11
notroj and others added 6 commits September 22, 2026 22:20
* modules/md/md_util.h, modules/md/md_util.c (md_util_exec_cmdline):
  New function, tokenizing only the configured command line and passing
  the remaining arguments verbatim.

* modules/md/md_acme_authz.c (md_acme_authz_update): Reject an
  authorization identifier which is not a DNS name or wildcard.
  (cha_dns_01_setup, cha_dns_01_teardown): Use md_util_exec_cmdline().

* modules/md/mod_md.c (notify): Use md_util_exec_cmdline() for
  MDNotifyCmd and MDMessageCmd.

* modules/md/md_acme_order.c (md_acme_order_start_challenges): Log the
  authz url, authz is NULL if the retrieve failed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
  test/modules/md/test_721_dns01.py: New test suite.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* modules/md/md_util.c (md_util_base64url_encode,
  md_util_base64url_decode): Implement using apr_pencode_base64_binary()
  and apr_pdecode_base64_binary() if APR is 1.7.0 or later, keeping the
  local implementation for older APR.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
  Use the curl binary the test framework is configured with.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* modules/md/md_crypt.c (chain_to_buffer): New function, rendering the
  chain into a memory BIO like cert_to_buffer() does for a single cert.
  (md_chain_fsave): Use it with md_util_freplace(), so an interrupted
  write no longer leaves a truncated pubcert.pem behind.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* modules/md/md_util.c (md_text_fcreatex): Return the status of the
  write and the close.  The permissions were set a second time here,
  overwriting the status; md_util_fcreatex() already sets them.
  (md_util_freplace): Keep the status of the last file creation, so a
  failure to create the temporary file can no longer be reported as
  success and have the write use an uninitialized handle.  Remove the
  temporary file when the write fails too, not only on rename failure.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant