chiark / gitweb /
keyfunc.sh.in: Don't let `userv' gobble our input.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 12 Feb 2012 23:00:03 +0000 (23:00 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 13 Feb 2012 00:25:30 +0000 (00:25 +0000)
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.

keyfunc.sh.in

index 6316816d075644f3f37fb9cb9c6e261705d6ae3e..0256dc0cb48e2820f9a0a6c71fc1e3b9c35028cc 100644 (file)
@@ -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 </dev/null
       ;;
     nil)
       $bindir/extract-profile "$label" $ETC/profile.d/ >$tmp/profile