Subject: Work around /dev/fd/ no longer being created by systemd Author: Christoph Biedl Date: 2020-11-22 Bug: https://github.com/latchset/clevis/issues/262 Bug-Debian: https://bugs.debian.org/968518 https://bugs.debian.org/979089 Last-Update: 2021-01-03 --- a/src/clevis-decrypt +++ b/src/clevis-decrypt @@ -46,7 +46,8 @@ exit 1 fi - exec "$cmd" < <(echo -n "$hdr."; /bin/cat) + (echo -n "$hdr."; /bin/cat) | "$cmd" + exit $? fi exec >&2 --- a/src/luks/clevis-luks-unlock +++ b/src/luks/clevis-luks-unlock @@ -65,4 +65,4 @@ exit 1 fi -cryptsetup open -d- "${DEV}" "${NAME}" < <(echo -n "${pt}") +echo -n "${pt}" | cryptsetup open -d- "${DEV}" "${NAME}" --- a/src/pins/tang/clevis-decrypt-tang +++ b/src/pins/tang/clevis-decrypt-tang @@ -88,4 +88,5 @@ tmp="$(jose jwk exc -i '{"alg":"ECMR"}' -l- -r- <<< "$eph$srv")" rep="$(jose jwk pub -i- <<< "$rep")" jwk="$(jose jwk exc -l- -r- <<< "$rep$tmp")" -exec jose jwe dec -k- -i- < <(echo -n "$jwk$hdr."; /bin/cat) +(echo -n "$jwk$hdr."; /bin/cat) | jose jwe dec -k- -i- +exit $? --- a/src/pins/tpm2/clevis-decrypt-tpm2 +++ b/src/pins/tpm2/clevis-decrypt-tpm2 @@ -165,8 +165,5 @@ exit 1 fi -# The on_exit() trap will not be fired after exec, so let's clean up the temp -# directory at this point. -[ -d "${TMP}" ] && rm -rf "${TMP}" - -exec jose jwe dec -k- -i- < <(echo -n "$jwk$hdr."; /bin/cat) +(echo -n "$jwk$hdr."; /bin/cat) | jose jwe dec -k- -i- +exit $?