Blame SOURCES/0002-systemd-account-for-unlocking-failures-in-clevis-luk.patch

260951
From d3010c89a8f516a0c9695a939a8cccca0918da2b Mon Sep 17 00:00:00 2001
260951
From: Sergio Correia <scorreia@redhat.com>
260951
Date: Fri, 29 Oct 2021 12:04:46 -0300
260951
Subject: [PATCH 2/2] systemd: account for unlocking failures in
260951
 clevis-luks-askpass (#343)
260951
260951
As unlock may fail for some reason, e.g. the network is not up yet,
260951
one way cause problems would be to add extra `rd.luks.uuid' params
260951
to the cmdline, which would then cause such devices to be unlocked
260951
in early boot. If the unlocking fail, those devices might not be
260951
accounted for in the clevis_devices_to_unlock() check, as it is
260951
based on crypttab.
260951
260951
Let's make sure there are no pending ask.* sockets waiting to be
260951
answered, before exiting.
260951
260951
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1878892
260951
---
260951
 src/luks/systemd/clevis-luks-askpass.in | 5 ++++-
260951
 1 file changed, 4 insertions(+), 1 deletion(-)
260951
260951
diff --git a/src/luks/systemd/clevis-luks-askpass.in b/src/luks/systemd/clevis-luks-askpass.in
260951
index 8f54859..a6699c9 100755
260951
--- a/src/luks/systemd/clevis-luks-askpass.in
260951
+++ b/src/luks/systemd/clevis-luks-askpass.in
260951
@@ -67,8 +67,11 @@ while true; do
260951
     done
260951
 
260951
     [ "${loop}" != true ] && break
260951
+
260951
     # Checking for pending devices to be unlocked.
260951
-    if remaining=$(clevis_devices_to_unlock) && [ -z "${remaining}" ]; then
260951
+    remaining_crypttab=$(clevis_devices_to_unlock) ||:
260951
+    remaining_askfiles=$(ls "${path}"/ask.* 2>/dev/null) ||:
260951
+    if [ -z "${remaining_crypttab}" ] && [ -z "${remaining_askfiles}" ]; then
260951
         break;
260951
     fi
260951
 
260951
-- 
260951
2.33.1
260951