Skip to content

fix: correct OS_ID parsing for quoted values in /etc/os-release#306993

Open
hellozzm wants to merge 1 commit intomicrosoft:mainfrom
hellozzm:fix-rocky-linux-os-id2
Open

fix: correct OS_ID parsing for quoted values in /etc/os-release#306993
hellozzm wants to merge 1 commit intomicrosoft:mainfrom
hellozzm:fix-rocky-linux-os-id2

Conversation

@hellozzm
Copy link
Copy Markdown

@hellozzm hellozzm commented Apr 1, 2026

Summary

Fixes #232159

check-requirements-linux.sh uses grep -Eo 'ID=([^"]+)' to extract the OS ID from /etc/os-release. This fails when the file contains quoted values like ID="rocky" (common on Rocky Linux 8.5+), producing an empty string and causing the script to behave incorrectly.

Changes

  • Replace grep -Eo + sed pipeline with source /etc/os-release && echo $ID, which correctly handles both quoted and unquoted values.

Testing

  • Verified that source /etc/os-release && echo $ID correctly extracts the ID regardless of quoting style.
  • The /etc/os-release format guarantees shell-safe values, so sourcing is safe here.

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.

Devcontainer setup ad-hoc parsing fails on Rocky 8.5

2 participants