Skip to content

Fix OPENDMARC_LIB_VERSION always being 0x00000000 in GitHub releases (issue #235)#301

Open
thegushi wants to merge 1 commit into
developfrom
fix/lib-version-235
Open

Fix OPENDMARC_LIB_VERSION always being 0x00000000 in GitHub releases (issue #235)#301
thegushi wants to merge 1 commit into
developfrom
fix/lib-version-235

Conversation

@thegushi
Copy link
Copy Markdown
Collaborator

@thegushi thegushi commented May 12, 2026

Summary

OPENDMARC_LIB_VERSION was hardcoded as 0x00000000 in libopendmarc/dmarc.h. The intended substitution happened in a dist-hook via sed at make dist time — but GitHub releases pull a raw git tarball, bypassing make dist entirely. Every package downloaded from the GitHub releases page shipped with the zeroed constant.

Fix: Convert libopendmarc/dmarc.h to an autoconf template (dmarc.h.in) with 0x@HEX_VERSION@ as the placeholder, and add it to AC_CONFIG_FILES. ./configure now generates the correctly-stamped header at build time regardless of how the source was obtained. For version 1.4.2 this produces 0x01040200.

This is the right fix for the primary consumers of OpenDMARC: OS packagers (Debian, Fedora, etc.) already run ./configure as part of their packaging workflow, so they will get a correctly-stamped dmarc.h automatically once dmarc.h.in is present in the source tree.

The now-redundant dmarc.h substitution lines in the dist-hook are removed. The generated libopendmarc/dmarc.h is added to .gitignore.

Closes #235.

Test plan

  • After running ./configure, verify libopendmarc/dmarc.h contains 0x01040200 (or the correct value for the current version)
  • Confirm make dist still works and the resulting tarball also has the correct value

…(issue #235)

OPENDMARC_LIB_VERSION was hardcoded as 0x00000000 in libopendmarc/dmarc.h.
The intended fix was a dist-hook in Makefile.am that used sed to substitute
the computed HEX_VERSION at 'make dist' time. GitHub releases pull a raw git
tarball directly, bypassing 'make dist' entirely, so the substitution never
happened and every released package shipped with the zeroed version.

Fix: convert libopendmarc/dmarc.h to a proper autoconf template
(libopendmarc/dmarc.h.in) with 0x@HEX_VERSION@ as the placeholder. Add
libopendmarc/dmarc.h to AC_CONFIG_FILES so ./configure generates the
correctly-stamped header at build time regardless of how the source was
obtained. For version 1.4.2 this produces 0x01040200.

Also: remove the now-redundant dmarc.h sed substitution from the dist-hook,
and add the generated libopendmarc/dmarc.h to .gitignore.

Note: distributors and packagers should use 'make dist' to produce release
tarballs and upload them as GitHub release assets, rather than relying on
GitHub's auto-generated source archives.
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