diff options
author | Christian Hesse <mail@eworm.de> | 2013-10-03 12:07:18 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2013-10-03 12:07:18 +0200 |
commit | 68a220bd2148c9544bf946878304a826fceea54a (patch) | |
tree | 93bc9b171b4ffd68ac1bcf479611783737c6805d /udev | |
parent | 0bd36841fb6a526619c282a2feee87f7908a0dbf (diff) | |
download | mkinitcpio-ykfde-68a220bd2148c9544bf946878304a826fceea54a.tar.gz mkinitcpio-ykfde-68a220bd2148c9544bf946878304a826fceea54a.tar.zst |
add timeout to inotifywait and exit on wrong message
systemd should manage to ask for the passphrase within two seconds.
Diffstat (limited to 'udev')
-rwxr-xr-x | udev/ykfde | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |