Fix bootstrap CLI handling and cleanup robustness in kInit.sh #24
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/kinit-bootstrap-audit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
Audit follow-up on the
kInit.shbootstrap. Six fixes, all inkInit.sh:--help/-hinparseBootstrapOptions()before the root check and theutils.shdownload, so help works without root or network access. A minimal color table is declared beforeutils.shis sourced (utils.sh re-declares the identical table).helpRequestedflag).--timeout/--triesto the bootstrap wget call (previously unbounded: wget defaults retry 20 times with a 900s read timeout) and honorKINIT_DOWNLOAD_TIMEOUTin both wget and curl branches.--*) in bootstrap option parsing, matchingrequireOptionValue()semantics;--base-url --analyzepreviously setBASE_URL="--analyze"and attempted a garbage download.utils.shdownload fails.showSummarygreps with|| trueso a servedkInit.varsmissing an*_EXECUTEkey cannot abort cleanup underset -e -o pipefail.Security / risk impact
No changes to the security-relevant paths: pinned bootstrap hash, checksum manifest validation, and HTTPS enforcement are untouched.
kInit.shis excluded fromchecksums.sha256andinstaller/utils.shis unchanged, so no hash regeneration was needed (verified: pinned hashes still match).Validation
bash -nand shellcheck clean (only pre-existing info-level SC2059 color-style notes remain)utils.sh), manifest validation (official URL + pinned hash; custom URL refused without explicit hash, accepted with correct hash, rejected with wrong hash),--base-urllocation derivation, secret/URL redaction, summary fallback--helpexits 0 without root/network; all four bad-argument paths exit 2 with correct messagessha256sum -c checksums.sha256passesCodex review
Verdict: no findings
No must-fix issues were found in the reviewed diff.
Risk appears low; the diff is narrowly scoped and I did not find a validated regression in the changed behavior.
Reviewed by Codex at
ea73fbad28. This comment is conservative and based only on the PR diff, metadata, and supplied repository context.