Skip to content

Commit 92b09c9

Browse files
systemd: account for unlocking failures in clevis-luks-askpass (#343)
As unlock may fail for some reason, e.g. the network is not up yet, one way cause problems would be to add extra `rd.luks.uuid' params to the cmdline, which would then cause such devices to be unlocked in early boot. If the unlocking fail, those devices might not be accounted for in the clevis_devices_to_unlock() check, as it is based on crypttab. Let's make sure there are no pending ask.* sockets waiting to be answered, before exiting. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1878892
1 parent 8c9e020 commit 92b09c9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/luks/systemd/clevis-luks-askpass.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ while true; do
6767
done
6868

6969
[ "${loop}" != true ] && break
70+
7071
# Checking for pending devices to be unlocked.
71-
if remaining=$(clevis_devices_to_unlock) && [ -z "${remaining}" ]; then
72+
remaining_crypttab=$(clevis_devices_to_unlock) ||:
73+
remaining_askfiles=$(ls "${path}"/ask.* 2>/dev/null) ||:
74+
if [ -z "${remaining_crypttab}" ] && [ -z "${remaining_askfiles}" ]; then
7275
break;
7376
fi
7477

0 commit comments

Comments
 (0)