]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Replace head -c by dd
authorGrégoire Jadi <gjadi@omecha.info>
Mon, 19 Feb 2018 16:45:03 +0000 (17:45 +0100)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 30 May 2018 16:23:16 +0000 (13:23 -0300)
The '-c' (count bytes) option is not a POSIX.1 option, therefore it is
not available on OpenBSD.

Replace 'head -c' with 'dd'.

Signed-off-by: Silvio Rhatto <rhatto@riseup.net>
lib/keyringer/actions/pwgen

index 5f254473091b44c1fb8c36720c6f710e91b42aa6..ab5cb8401a86d93497cb7dbbcde33367689a8166 100755 (executable)
@@ -18,7 +18,7 @@ function keyringer_pwgen {
 
   # Strip possible newlines if output is wrapped.
   # Also strip trailing = signs as they add nothing to the password's entropy.
-  head -c $ENTROPY_BYTES $ENTROPY_SOURCE | base64 | tr -d '\n='
+  dd bs=1 count=$ENTROPY_BYTES if=$ENTROPY_SOURCE | base64 | tr -d '\n='
   echo
 }