Conversation
Eight specs gate a STIG build variant on STIG_HARDEN, and every one of them pins it with a plain define in the spec body: 90/libpwquality 90/Linux-PAM 90/openssh 90/systemd libpwquality Linux-PAM openssh shadow A define in the spec body is evaluated during parse and overwrites anything passed with --define, so the flag cannot be set from pkg_build_options.json, from the Makefile, or from the rpmbuild command line. Photon's builder feeds every per-package macro as -D (PackageUtils.py:345), so that is the only channel there is. The consequence is not that the variant builds wrongly - it is that the variant has never been built at all. None of these conditionals has ever been parsed, and defects accumulated in them unseen. In SPECS/systemd that amounted to a duplicate patch index and a patch file missing from the directory, either of which aborts the build outright. Replace the plain define with a define-if-unset in all eight. Same default, but now overridable, so the STIG constellation can actually be selected and tested. No change to any build Photon performs today: with STIG_HARDEN unset the value is still 0 and the expanded spec is identical. Change-Id: I493ced005deb825e078dd9ddf56552444b47874c Signed-off-by: Daniel Casota <dcasota@gmail.com>
dcasota
force-pushed
the
fix/stig-harden-reachable
branch
from
September 9, 2026 11:17
10113ad to
b955874
Compare
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.
Eight specs gate a STIG build variant on
STIG_HARDEN, and every one pins it with a plain%definein the spec body.The constellation this breaks
Which constellation is affected:
STIG_HARDEN=1— on every arch, every subrelease, every ISO type. It is currently unreachable, which means it has never been built.A
%definein the spec body is evaluated during parse and overwrites anything passed with--define. Photon's builder feeds every per-package macro frompkg_build_options.jsonas-D(PackageUtils.py:345:for macro in macros: rpmBuildcmd += ["-D", macro]), so that is the only channel that exists. Verified two ways:The consequence isn't that the variant builds wrongly — it's that the variant has never been parsed at all, so defects accumulate in it unseen. In
SPECS/systemdthat had reached a duplicate patch index and a patch file missing from the directory, either of which aborts the build outright (fixed separately in #1671).The change
%define STIG_HARDEN 0→%{!?STIG_HARDEN: %global STIG_HARDEN 0}in all eight:90/libpwquality·90/Linux-PAM·90/openssh·90/systemd·libpwquality·Linux-PAM·openssh·shadowSame default, now overridable.
Testing — both constellations, all eight specs
Parse matrix, at each spec's own subrelease (90 for the
SPECS/90tree, 91 wherebuild_ifrequires it):Parsing alone isn't proof of buildability — the systemd defect was a missing file that parsing never caught — so every
Source:/Patch:reachable in each cell was also resolved against the builder's staging model (rpm resolves local sources by basename;PackageUtils.py:70-75stages a package's sources into a flatSOURCES/):support/spec-checker/check_spec.pyexits 0 on all eight.Why the default build is unaffected
With
STIG_HARDENunset the macro still evaluates to0, so every conditional takes the same branch as before and the expanded spec is unchanged. Release bumps and changelog entries only.Note on
shadow: it declaresSource12:twice, but in mutually exclusive%ifbranches — that is the correct pattern and needs no change. (rpm resolves both toSOURCES/useradd, since local sources resolve by basename.)Rebased and re-verified 2026-09-09
Rebased onto 5.0
294c3ce28. The conflict was inopenssh.spec, where upstreamupgraded 10.4p1 → 10.5p1 (CVE-2026-73281/73282/73283). Upstream's version
and its changelog entry are kept; this PR's entry is re-versioned to
10.5p1-2. Bookkeeping only — the%{!?STIG_HARDEN: ...}change itself mergedunchanged, and still lands in all eight specs.
The premise still holds against current 5.0: all four spot-checked specs
(
openssh,shadow,Linux-PAM,libpwquality) still carry the plain%define STIG_HARDEN 0, so every STIG conditional in them remains unreachablefrom
-Dorpkg_build_options.json.check_spec.pyexits 0 on all eight specs.Scope note
This PR makes a build mode reachable; it does not change any shipped default.
STIG_HARDENis still 0 unless explicitly set, so the permutation matrix'sresults are unaffected by it either way — no row currently builds with
STIG_HARDEN=1. That is precisely the gap it exists to close.