Fix OPENDMARC_LIB_VERSION always being 0x00000000 in GitHub releases (issue #235)#301
Open
thegushi wants to merge 1 commit into
Open
Fix OPENDMARC_LIB_VERSION always being 0x00000000 in GitHub releases (issue #235)#301thegushi wants to merge 1 commit into
thegushi wants to merge 1 commit into
Conversation
…(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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OPENDMARC_LIB_VERSIONwas hardcoded as0x00000000inlibopendmarc/dmarc.h. The intended substitution happened in adist-hookviasedatmake disttime — but GitHub releases pull a raw git tarball, bypassingmake distentirely. Every package downloaded from the GitHub releases page shipped with the zeroed constant.Fix: Convert
libopendmarc/dmarc.hto an autoconf template (dmarc.h.in) with0x@HEX_VERSION@as the placeholder, and add it toAC_CONFIG_FILES../configurenow generates the correctly-stamped header at build time regardless of how the source was obtained. For version 1.4.2 this produces0x01040200.This is the right fix for the primary consumers of OpenDMARC: OS packagers (Debian, Fedora, etc.) already run
./configureas part of their packaging workflow, so they will get a correctly-stampeddmarc.hautomatically oncedmarc.h.inis present in the source tree.The now-redundant
dmarc.hsubstitution lines in thedist-hookare removed. The generatedlibopendmarc/dmarc.his added to.gitignore.Closes #235.
Test plan
./configure, verifylibopendmarc/dmarc.hcontains0x01040200(or the correct value for the current version)make diststill works and the resulting tarball also has the correct value