mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
fix(install): support older awk checksum parsing (#28784)
## Why The standalone installer validates package checksums with an awk interval expression. Older mawk releases do not support that expression, so they reject valid 64-character digests and report that the release manifest is missing an entry. This affects both x64 and ARM64 systems on common Debian-derived environments. Fixes #24219. ## What Changed Replace the awk interval expression with an explicit length check plus rejection of non-hexadecimal characters. This preserves the existing SHA-256 validation and lowercase normalization while working with older awk implementations. ## How to Test 1. Build and run the checksum predicate with mawk 1.3.4 20121129. 2. Confirm the old interval predicate rejects a valid 64-character digest. 3. Confirm the updated predicate accepts that digest. 4. Put the old mawk binary first on PATH as awk and run scripts/install/install.sh with an isolated HOME, CODEX_HOME, and CODEX_INSTALL_DIR. 5. Confirm Codex installs successfully and the installed binary reports version 0.140.0. 6. Verify the predicate rejects wrong-length digests, non-hexadecimal digests, and entries for another asset while accepting uppercase hexadecimal digests.
This commit is contained in:
committed by
GitHub
Unverified
parent
dbd2857f4b
commit
f22d15b679
@@ -213,7 +213,7 @@ package_archive_digest() {
|
||||
manifest_path="$2"
|
||||
|
||||
digest="$(awk -v asset="$asset" '
|
||||
$2 == asset && $1 ~ /^[0-9a-fA-F]{64}$/ {
|
||||
$2 == asset && length($1) == 64 && $1 !~ /[^0-9a-fA-F]/ {
|
||||
print tolower($1)
|
||||
found = 1
|
||||
exit
|
||||
|
||||
Reference in New Issue
Block a user