From: Mark Wooding Date: Sun, 12 Feb 2012 23:00:03 +0000 (+0000) Subject: keyfunc.sh.in: Don't let `userv' gobble our input. X-Git-Tag: 0.99.2~37 X-Git-Url: https://git.distorted.org.uk/~mdw/distorted-keys/commitdiff_plain/21a21fffb6e2d0cbddec155916a8257bb52d4d0d keyfunc.sh.in: Don't let `userv' gobble our input. Unfortunately, `userv' has a bad habit of eating our stdin, whether it needs it or not. (This is a result of the `cat' processes and pipes strung between the calling and service environments.) To prevent this from gobbling our input, which we might actually want to process ourselves in some way, make sure that we let it chew on something less important. Like `/dev/null', say. --- diff --git a/keyfunc.sh.in b/keyfunc.sh.in index 6316816..0256dc0 100644 --- a/keyfunc.sh.in +++ b/keyfunc.sh.in @@ -308,8 +308,11 @@ nubid () { ## Compute a hash of the key nub in stdin, and write it to stdout in hex. ## The property `nubid_hash' is used. - { echo "distorted-keys nubid"; cat -; } | - openssl dgst -${kprop_nubid_hash-sha256} + ## Stupid dance because the output incompatibly grew a filename, in order + ## to demonstrate the same idiocy as GNU mumblesum. + set _ $({ echo "distorted-keys nubid"; cat -; } | + openssl dgst -${kprop_nubid_hash-sha256}) + echo $2 } subst () { @@ -382,7 +385,7 @@ read_profile () { case $uservp in t) checkword "profile user" "$user" - userv "$user" cryptop-profile "$label" >$tmp/profile + userv "$user" cryptop-profile "$label" >$tmp/profile $tmp/profile