summaryrefslogtreecommitdiffstats
path: root/udev/ykfde
diff options
context:
space:
mode:
Diffstat (limited to 'udev/ykfde')
-rwxr-xr-xudev/ykfde5
1 files changed, 3 insertions, 2 deletions
diff --git a/udev/ykfde b/udev/ykfde
index 3646890..4d3af57 100755
--- a/udev/ykfde
+++ b/udev/ykfde
@@ -10,7 +10,8 @@ source /etc/ykfde.conf
ykchalresp -${YKFDE_SLOT:-2} "$(cat /ykfde-challenge)" 2>/dev/null | tr -d '\n' > /crypto_keyfile.bin
# if the systemd unit was faster try to answer password agent
-for REQUEST in $(grep -l '^Message=Please enter passphrase for disk' /run/systemd/ask-password/ask.* || \
- inotifywait -q --format %w%f -e MOVED_TO /run/systemd/ask-password/); do
+for REQUEST in $(ls -1 /run/systemd/ask-password/ask.* || \
+ inotifywait --quiet --format %w%f --event MOVED_TO --timeout 2 /run/systemd/ask-password/); do
+ grep -q '^Message=Please enter passphrase for disk' ${REQUEST} || exit 1
/usr/lib/systemd/systemd-reply-password 1 $(grep '^Socket=' ${REQUEST} | cut -d= -f2) < /crypto_keyfile.bin
done