Browse Source

Work around /dev/fd/<num> no longer being created by systemd. Closes: #968518

Thanks Andreas Pommer for the bug report and initial patch.
Christoph Biedl 3 years ago
parent
commit
092ad0fe6a

+ 1 - 0
debian/patches/series

@@ -3,6 +3,7 @@
 upstream.use-asciidoctor-to-build-manpages.patch
 upstream.embed-tpm-modules-in-initramfs.patch
 upstream.embed-more-programs-in-initram.patch
+upstream.work-around-missing-dev-fd-links.patch
 
 # patches for Debian
 debian.set-unprivileged-user.patch

+ 36 - 0
debian/patches/upstream.work-around-missing-dev-fd-links.patch

@@ -0,0 +1,36 @@
+Subject: Work around /dev/fd/<num> no longer being created by systemd
+Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Date: 2020-05-21
+Bug: https://github.com/latchset/clevis/issues/262
+Bug-Debian: https://bugs.debian.org/968518
+
+--- 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/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
+@@ -169,4 +169,5 @@
+ # 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 $?