Merge pull request #2667 from flatcar/ca-certs-missing-newline-fix

app-misc/ca-certificates: Account for certs missing newlines
This commit is contained in:
Jeremi Piotrowski 2025-02-24 17:05:34 +01:00 committed by GitHub
commit d3c8c8f4a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1 @@
- Fix update-ca-certificates behavior when concatenating certificates with missing trailing newlines. ([flatcar/scripts#2667](https://github.com/flatcar/scripts/pull/2667))

View File

@ -32,7 +32,8 @@ if [[ ! -e "${CERTBUNDLE}" || "${CERTSDIR}" -nt "${CERTBUNDLE}" ]]; then
trap "rm -f '${CERTSDIR}/${TEMPBUNDLE}'" EXIT
# Use .0 instead of .pem to pull in only what c_rehash validated
cat "${CERTSDIR}"/*.[0-9] > "${TEMPBUNDLE}"
sed --separate '$a\' "${CERTSDIR}"/*.[0-9] >"${TEMPBUNDLE}"
chmod 644 "${TEMPBUNDLE}"
mv -f "${TEMPBUNDLE}" "${CERTBUNDLE}"
trap - EXIT