From 18006e4e31e0751e77d92e5780533d2ed070592f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 1 Oct 2013 14:31:52 +0200 Subject: remove newline from response, answer password agent --- udev/ykfde | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'udev') diff --git a/udev/ykfde b/udev/ykfde index ce83117..e3fec3d 100755 --- a/udev/ykfde +++ b/udev/ykfde @@ -6,4 +6,10 @@ source /etc/ykfde.conf # yet another add event. Ignore if the file exists. [ -s /crypto_keyfile.bin ] && exit 0 -ykchalresp -${YKFDE_SLOT:-2} "$(cat /ykfde-challenge)" > /crypto_keyfile.bin 2>/dev/null +# write the response to keyfile +ykchalresp -${YKFDE_SLOT:-2} "$(cat /ykfde-challenge)" | tr -d '\n' > /crypto_keyfile.bin 2>/dev/null + +# if the systemd unit was faster try to answer password agent +for REQUEST in $(grep -l '^Message=Please give passphrase for disk' /run/systemd/ask-password/ask.*); do + /usr/lib/systemd/systemd-reply-password 1 $(grep '^Socket=' ${REQUEST} | cut -d= -f2) < /crypto_keyfile.bin +done -- cgit v1.2.3-70-g09d2