platform.m4: Fix case when we have to source /etc/os-release#8397
Merged
Conversation
There was a problem hiding this comment.
Code Review
The pull request correctly identifies and fixes an issue where sourcing /etc/os-release can clobber the VERSION variable. However, the fix can be made more robust and portable. My review includes a suggestion to use a subshell to source /etc/os-release, which prevents clobbering of any shell variables, not just VERSION. This approach is cleaner and safer. Additionally, I've corrected a non-POSIX [[ test to a portable [ test, which was a pre-existing bug in this code block.
thalman
requested changes
Jan 29, 2026
arrowd
force-pushed
the
platform-os-release
branch
from
January 29, 2026 15:00
ef58252 to
0f3e51a
Compare
pbrezina
approved these changes
Jan 30, 2026
thalman
approved these changes
Jan 30, 2026
thalman
left a comment
Contributor
There was a problem hiding this comment.
OK, somehow I overlooked that change, sorry and thanks.
When sourcing this file it may overwrite the VERSION shell variable, which in turn end up being used for @Version@ substitutions in various .in files. While here, make sure we always set $osname to something sensible too. Reviewed-by: Pavel Březina <[email protected]> Reviewed-by: Tomáš Halman <[email protected]>
Contributor
sssd-bot
force-pushed
the
platform-os-release
branch
from
January 30, 2026 15:44
0f3e51a to
0b54224
Compare
reubeno
added a commit
to reubeno/azurelinux
that referenced
this pull request
Apr 10, 2026
…ariable Add upstream patch from SSSD/sssd#8397 that fixes platform.m4 sourcing /etc/os-release and inadvertently overwriting the VERSION shell variable, which causes incorrect @Version@ substitutions in various .in files. The patch also ensures $osname is always initialized to a sensible default. Moved sssd from inline definition in components.toml to a dedicated comp.toml to support the patch-add overlay. Co-authored-by: Copilot <[email protected]>
christopherco
pushed a commit
to microsoft/azurelinux
that referenced
this pull request
Apr 10, 2026
…ariable Add upstream patch from SSSD/sssd#8397 that fixes platform.m4 sourcing /etc/os-release and inadvertently overwriting the VERSION shell variable, which causes incorrect @Version@ substitutions in various .in files. The patch also ensures $osname is always initialized to a sensible default. Moved sssd from inline definition in components.toml to a dedicated comp.toml to support the patch-add overlay. Co-authored-by: Copilot <[email protected]>
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.
When sourcing this file it may overwrite the VERSION shell variable, which in turn end up being used for @Version@ substitutions in various .in files.
I was lucky to catch this when preparing a FreeBSD port update.
Spec reference: https://www.freedesktop.org/software/systemd/man/latest/os-release.html#VERSION=