Skip to content

Commit d6c0d42

Browse files
committed
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 <[email protected]>
1 parent 707490d commit d6c0d42

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

sdk_container/src/third_party/coreos-overlay/app-misc/ca-certificates/files/update-ca-certificates

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ if [[ ! -e "${CERTBUNDLE}" || "${CERTSDIR}" -nt "${CERTBUNDLE}" ]]; then
3232
trap "rm -f '${CERTSDIR}/${TEMPBUNDLE}'" EXIT
3333

3434
# Use .0 instead of .pem to pull in only what c_rehash validated
35-
cat "${CERTSDIR}"/*.[0-9] > "${TEMPBUNDLE}"
35+
for f in "${CERTSDIR}"/*.[0-9]; do
36+
sed '$a\' "${f}"
37+
done > "${TEMPBUNDLE}"
38+
3639
chmod 644 "${TEMPBUNDLE}"
3740
mv -f "${TEMPBUNDLE}" "${CERTBUNDLE}"
3841
trap - EXIT

0 commit comments

Comments
 (0)