Skip to content

Commit

Permalink
tls: force write certificates to disk
Browse files Browse the repository at this point in the history
On embedded devices such as a RPI storage is more fragile and power loss
can happen more frequently.

Co-Authored-By: Jean-Marie Lemetayer <j.lemetayer@kerlink.fr>
  • Loading branch information
2 people authored and martinpitt committed Nov 1, 2024
1 parent b66d6c8 commit 5229d60
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tls/cockpit-certificate-helper.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ install_cert() {

# The certificate should be world-readable
chmod a+r "${destination}"

# Force flush to disk for embedded devices
sync "${destination}"
}

install_key() {
local destination="${COCKPIT_WS_CERTS_D}/$1"
mv -Z "$1" "${destination}"

# Force flush to disk for embedded devices
sync "${destination}"
}

selfsign_sscg() {
Expand Down

0 comments on commit 5229d60

Please sign in to comment.