mirror of
https://github.com/flatcar/scripts.git
synced 2025-12-23 02:01:34 +01:00
app-misc/ca-certificates: Account for certs missing newlines
Concatenating certificates missing newlines naively with cat results in broken bundle. Fix the issue by using a sed expression that appends a trailing newline after the lastline if it is missing. Issue: flatcar/flatcar#1601 Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
parent
5bf6167cb2
commit
2379713951
@ -32,7 +32,8 @@ if [[ ! -e "${CERTBUNDLE}" || "${CERTSDIR}" -nt "${CERTBUNDLE}" ]]; then
|
|||||||
trap "rm -f '${CERTSDIR}/${TEMPBUNDLE}'" EXIT
|
trap "rm -f '${CERTSDIR}/${TEMPBUNDLE}'" EXIT
|
||||||
|
|
||||||
# Use .0 instead of .pem to pull in only what c_rehash validated
|
# 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}"
|
chmod 644 "${TEMPBUNDLE}"
|
||||||
mv -f "${TEMPBUNDLE}" "${CERTBUNDLE}"
|
mv -f "${TEMPBUNDLE}" "${CERTBUNDLE}"
|
||||||
trap - EXIT
|
trap - EXIT
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user